Skip to content

Commit 91a6c15

Browse files
authored
[docs] Restructure "Set up pre-commit hooks" section in development.md (#4068)
1 parent 32aff8c commit 91a6c15

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

docs/development.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,30 @@
4747
python -m pip install -r requirements.txt -r torchvision-requirements.txt
4848
```
4949

50+
### Set up pre-commit hooks
5051

51-
### (Optional) Set up pre-commit
52+
We recommend linting and formatting your commits _before_ the CI has a chance to complain about it.
5253

53-
This project uses [pre-commit](https://pre-commit.com/) in its CI. You can
54-
install it locally too in order to lint and fix your code prior to the CI
55-
complaining about it.
54+
1. Install [pre-commit](https://pre-commit.com/)
5655

57-
```shell
58-
pip install pre-commit
59-
# You can run interactively with `pre-commit run`
60-
# or install hooks so it runs automatically:
61-
pre-commit install
62-
```
56+
```shell
57+
pip install pre-commit
58+
```
59+
60+
- This is the same package used by the CI.
61+
1. Either:
62+
- Run the hooks manually.
63+
64+
```shell
65+
pre-commit run
66+
```
67+
68+
OR
69+
- Install them so they run automatically.
70+
71+
```shell
72+
pre-commit install
73+
```
6374

6475
## Building
6576

0 commit comments

Comments
 (0)