Check Jupyter notebooks by default, in sync with 0.6.0 (#96)

This commit is contained in:
Henry Schreiner 2024-08-15 12:25:51 -04:00 committed by GitHub
parent 718fbf5fa5
commit 20d9ac3f11
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -3,7 +3,7 @@
description: "Run 'ruff' for extremely fast Python linting" description: "Run 'ruff' for extremely fast Python linting"
entry: ruff check --force-exclude entry: ruff check --force-exclude
language: python language: python
types_or: [python, pyi] types_or: [python, pyi, jupyter]
args: [] args: []
require_serial: true require_serial: true
additional_dependencies: [] additional_dependencies: []
@ -14,7 +14,7 @@
description: "Run 'ruff format' for extremely fast Python formatting" description: "Run 'ruff format' for extremely fast Python formatting"
entry: ruff format --force-exclude entry: ruff format --force-exclude
language: python language: python
types_or: [python, pyi] types_or: [python, pyi, jupyter]
args: [] args: []
require_serial: true require_serial: true
additional_dependencies: [] additional_dependencies: []

View File

@ -41,7 +41,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
@ -50,11 +50,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