Skip to content

Commit 5c676d3

Browse files
committed
Edit the pre-commit explanations
With a little help from my friend, Gemini.
1 parent 8182375 commit 5c676d3

1 file changed

Lines changed: 21 additions & 20 deletions

File tree

CONTRIBUTING.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -180,34 +180,45 @@ ready, create a pull request from your branch to the main project repository.
180180

181181
where `YOUR_BRANCH_NAME` is the name of your new branch.
182182

183-
### `git` configuration
183+
### Git configuration
184184

185185
The following command will set up large refactoring revisions to be ignored by `git blame`:
186186

187187
```bash
188188
git config blame.ignoreRevsFile .git-blame-ignore-revs
189189
```
190190

191-
### Pre-commit git hooks (optional)
191+
### Git hooks configuration (optional)
192192

193-
The project includes a `.pre-commit-config.yaml` file for [pre-commit](https://pre-commit.com), an
194-
open-source utility that configures functions to run when triggered by certain git operations such
195-
as `git commit`. This can help you meet project conventions, at the cost of introducing small delays
196-
in `git commit` and `git push` operations. If you want to use `pre-commit`, you can install and
197-
configure it like this:
193+
This project includes a `.pre-commit-config.yaml` file for [pre-commit](https://pre-commit.com), an
194+
open-source utility that configures git hook functions to run when triggered by git operations such
195+
as committing changes, pushing changes, or writing commit messages. These hooks perform various
196+
checks that can help you meet project conventions automatically, at the cost of introducing small
197+
delays in those git operations. If you want to use `pre-commit`, you can install and configure it
198+
like this:
198199

199200
```shell
200201
pip install pre-commit
201202
pre-commit install -t pre-commit -t pre-push -t commit-msg
202203
```
203204

204-
Next, run it once after installation to initialize it:
205+
Next, run it once after installation to download the hook environments and verify your setup:
205206

206207
```shell
207-
pre-commit run
208+
pre-commit run --all-files
208209
```
209210

210-
After that, `pre-commit` will run automatically when triggered by specific git operations.
211+
After that, the hooks will run automatically when triggered by the corresponding git operations.
212+
213+
### Type annotation conventions
214+
215+
Code should have [type annotations](https://www.python.org/dev/peps/pep-0484/). We use
216+
[mypy](http://mypy-lang.org/) to check that type annotations are correct, and the following script
217+
to run it:
218+
219+
```shell
220+
check/mypy
221+
```
211222

212223
### Python setup
213224

@@ -228,16 +239,6 @@ After that, `pre-commit` will run automatically when triggered by specific git o
228239
Please refer to the section _Developer install_ of the [installation instructions](docs/install.md)
229240
for information about how to set up a local copy of the software for development.
230241
231-
### Type annotation conventions
232-
233-
Code should have [type annotations](https://www.python.org/dev/peps/pep-0484/). We use
234-
[mypy](http://mypy-lang.org/) to check that type annotations are correct, and the following script
235-
to run it:
236-
237-
```shell
238-
check/mypy
239-
```
240-
241242
### Linting and formatting
242243
243244
Code should meet common style standards for Python and be free of error-prone constructs. We use

0 commit comments

Comments
 (0)