Fix outdated doc for handling the default file types with the pre-commit hook (#15401)

Co-authored-by: Antoine DECHAUME <>
This commit is contained in:
Antoine Dechaume 2025-01-10 15:49:23 +01:00 committed by GitHub
parent 6e9ff445fd
commit 73d424ee5e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -128,7 +128,7 @@ To enable lint fixes, add the `--fix` argument to the lint hook:
- id: ruff-format - id: ruff-format
``` ```
To run the hooks over Jupyter Notebooks too, add `jupyter` to the list of allowed filetypes: To avoid running on Jupyter Notebooks, remove `jupyter` from the list of allowed filetypes:
```yaml ```yaml
- repo: https://github.com/astral-sh/ruff-pre-commit - repo: https://github.com/astral-sh/ruff-pre-commit
@ -137,11 +137,11 @@ To run the hooks over Jupyter Notebooks too, add `jupyter` to the list of allowe
hooks: hooks:
# Run the linter. # Run the linter.
- id: ruff - id: ruff
types_or: [ python, pyi, jupyter ] types_or: [ python, pyi ]
args: [ --fix ] args: [ --fix ]
# Run the formatter. # Run the formatter.
- id: ruff-format - id: ruff-format
types_or: [ python, pyi, jupyter ] types_or: [ python, pyi ]
``` ```
When running with `--fix`, Ruff's lint hook should be placed _before_ Ruff's formatter hook, and When running with `--fix`, Ruff's lint hook should be placed _before_ Ruff's formatter hook, and