Skip to content

Commit

Permalink
Merge pull request #1834 from pzelnip/patch-1
Browse files Browse the repository at this point in the history
Minor improvements to pre-commit.md
  • Loading branch information
timothycrosley committed Oct 28, 2021
2 parents 0c24ace + b1c5d7b commit ba81f1c
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions docs/configuration/pre-commit.md
Expand Up @@ -7,9 +7,20 @@ isort provides official support for [pre-commit](https://pre-commit.com/).

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

```yaml
- repo: https://github.com/pycqa/isort
rev: 5.9.3
hooks:
- id: isort
name: isort (python)
```

under the `repos` section of your projects `.pre-commit-config.yaml` file. Optionally if you want to have different hooks
over different file types (ex: python vs cython vs pyi) you can do so with the following config:

```yaml
- repo: https://github.com/pycqa/isort
rev: 5.8.0
rev: 5.9.3
hooks:
- id: isort
name: isort (python)
Expand All @@ -21,8 +32,6 @@ To use isort's official pre-commit integration add the following config:
types: [pyi]
```

under the `repos` section of your projects `.pre-commit-config.yaml` file.

### seed-isort-config

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

0 comments on commit ba81f1c

Please sign in to comment.