Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ install the required packages with `pip`:

```sh
pip install -e ".[dev]"
pre-commit install
prek install
gitlint install-hook
```

## Pre-commit hooks

The g2p team has agreed to systematically use a number of pre-commit hooks to
normalize formatting of code. You can install and enable pre-commit to have these used
normalize formatting of code. You can install and enable prek or pre-commit to have these used
automatically when you do your own commits.

Pre-commit hooks enabled:
Expand All @@ -56,15 +56,15 @@ Pre-commit hooks enabled:

### Enabling pre-commit hooks

All the pre-commit hooks are executed using a tool called
[pre-commit](https://pre-commit.com/). Once you enable pre-commit, it will run all the
All the pre-commit hooks are executed using either [prek](https://prek.j178.dev/) (recommended), or
[pre-commit](https://pre-commit.com/) (equivalent but slower). Once you enable either, it will run all the
hooks each time you try to commit anything in this repo.

We've added all the developer dependencies for the project to the
`dev` environment to make them easy to install with `hatch`. In
addition, `pre-commit` and `gitlint` hooks will be installed on
addition, `prek` and `gitlint` hooks will be installed on
creation of this environment. Note that you will have to use the
`dev` environment when committing since pre-commit is installed there.
`dev` environment when committing since prek is installed there.
You can either start a shell:

```sh
Expand All @@ -82,7 +82,7 @@ install the required packages with `pip`:

```sh
pip install -e ".[dev]"
pre-commit install
prek install
```

## commitlint
Expand Down Expand Up @@ -134,12 +134,12 @@ These rules are inspired by these commit formatting guides:

### Enabling commitlint

We run commitlint on each commit message that you write by enabling the commit-msg hook in
We run gitlint on each commit message that you write by enabling the commit-msg hook in
Git.

The commit-msg hook is enabled on creation of the `dev` environment
with `hatch`. Note that you will have to use the `dev` environment
when committing since pre-commit is installed there. You can either
when committing since gitlint is installed there. You can either
start a shell:

```sh
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ dev = [
"g2p[test]",
"gitlint-core>=0.17.0",
"mypy>=1.8.0",
"pre-commit>=3.2.0",
"prek",
]
# This one is a bit special and cannot depend on other features,
# because if it depends on `g2p[api]` then we end up with
Expand Down Expand Up @@ -182,7 +182,7 @@ cov = ["test-cov", "cov-report"]

[tool.hatch.envs.dev]
features = ["dev"]
post-install-commands = ["pre-commit install", "gitlint install-hook || true"]
post-install-commands = ["prek install", "gitlint install-hook || true"]

[tool.hatch.envs.dev.scripts]
check = "mypy {args:g2p}"
Expand Down
Loading