diff --git a/docs/configuration/pre-commit.md b/docs/configuration/pre-commit.md index 19362f816..4238483bb 100644 --- a/docs/configuration/pre-commit.md +++ b/docs/configuration/pre-commit.md @@ -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) @@ -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.