Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor improvements to pre-commit.md #1834

Merged
merged 1 commit into from Oct 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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