From d87e2b0f73c652a038d10877ab24fdedb470e463 Mon Sep 17 00:00:00 2001 From: Ali Hamdan Date: Mon, 10 Jul 2023 21:03:43 +0200 Subject: [PATCH] Revert adding toml and jupyter (#45) See https://github.com/astral-sh/ruff-pre-commit/issues/44#issuecomment-1629510474 --- .github/workflows/main.yml | 2 +- README.md | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ea64ea2..5b44ede 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,7 @@ jobs: git config user.name 'Github Actions' git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' - - run: pre-commit-mirror --language python --package-name ruff --entry 'ruff check --force-exclude' --id ruff --types-or python --types-or pyi --types-or jupyter --types-or toml --require-serial --description "Run 'ruff' for extremely fast Python linting" . + - run: pre-commit-mirror --language python --package-name ruff --entry 'ruff check --force-exclude' --id ruff --types-or python --types-or pyi --require-serial --description "Run 'ruff' for extremely fast Python linting" . - run: git push origin HEAD:refs/heads/main --tags diff --git a/README.md b/README.md index 18ccd5a..5979d98 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,17 @@ Or, to enable autofix: args: [--fix, --exit-non-zero-on-fix] ``` +To run the hook on Jupyter Notebooks too: + +```yaml +- repo: https://github.com/astral-sh/ruff-pre-commit + # Ruff version. + rev: v0.0.277 + hooks: + - id: ruff + types_or: [python, pyi, jupyter] +``` + Ruff's pre-commit hook should be placed after other formatting tools, such as Black and isort, _unless_ you enable autofix, in which case, Ruff's pre-commit hook should run _before_ Black, isort, and other formatting tools, as Ruff's autofix behavior can output code changes that require