From 20d9ac3f11a7098292f592ee2698d37b23282b1a Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 15 Aug 2024 12:25:51 -0400 Subject: [PATCH] Check Jupyter notebooks by default, in sync with 0.6.0 (#96) --- .pre-commit-hooks.yaml | 4 ++-- README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 2c1ddf8..491cc71 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -3,7 +3,7 @@ description: "Run 'ruff' for extremely fast Python linting" entry: ruff check --force-exclude language: python - types_or: [python, pyi] + types_or: [python, pyi, jupyter] args: [] require_serial: true additional_dependencies: [] @@ -14,7 +14,7 @@ description: "Run 'ruff format' for extremely fast Python formatting" entry: ruff format --force-exclude language: python - types_or: [python, pyi] + types_or: [python, pyi, jupyter] args: [] require_serial: true additional_dependencies: [] diff --git a/README.md b/README.md index 5271777..1dcd6df 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ To enable lint fixes, add the `--fix` argument to the lint hook: - 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 - 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: # Run the linter. - id: ruff - types_or: [ python, pyi, jupyter ] + types_or: [ python, pyi ] args: [ --fix ] # Run the formatter. - 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