Skip to content

Commit ba81f1c

Browse files
authoredOct 28, 2021
Merge pull request #1834 from pzelnip/patch-1
Minor improvements to pre-commit.md
2 parents 0c24ace + b1c5d7b commit ba81f1c

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed
 

‎docs/configuration/pre-commit.md

+12-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,20 @@ isort provides official support for [pre-commit](https://pre-commit.com/).
77

88
To use isort's official pre-commit integration add the following config:
99

10+
```yaml
11+
- repo: https://github.com/pycqa/isort
12+
rev: 5.9.3
13+
hooks:
14+
- id: isort
15+
name: isort (python)
1016
```
17+
18+
under the `repos` section of your projects `.pre-commit-config.yaml` file. Optionally if you want to have different hooks
19+
over different file types (ex: python vs cython vs pyi) you can do so with the following config:
20+
21+
```yaml
1122
- repo: https://github.com/pycqa/isort
12-
rev: 5.8.0
23+
rev: 5.9.3
1324
hooks:
1425
- id: isort
1526
name: isort (python)
@@ -21,8 +32,6 @@ To use isort's official pre-commit integration add the following config:
2132
types: [pyi]
2233
```
2334

24-
under the `repos` section of your projects `.pre-commit-config.yaml` file.
25-
2635
### seed-isort-config
2736

2837
Older versions of isort used a lot of magic to determine import placement, that could easily break when running on CI/CD.

0 commit comments

Comments
 (0)
Please sign in to comment.