diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d45d484..cfc9a44 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -57,7 +57,7 @@ jobs: echo $TAG_NAME gh release create "$TAG_NAME" \ --title "$TAG_NAME" \ - --notes "See: https://github.com/astral-sh/ruff/releases/tag/$TAG_NAME" \ + --notes "See: https://github.com/astral-sh/ruff/releases/tag/${TAG_NAME/v}" \ --latest env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 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 fb134e8..0895428 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # ruff-pre-commit [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) -[![image](https://img.shields.io/pypi/v/ruff/0.4.10.svg)](https://pypi.python.org/pypi/ruff) -[![image](https://img.shields.io/pypi/l/ruff/0.4.10.svg)](https://pypi.python.org/pypi/ruff) -[![image](https://img.shields.io/pypi/pyversions/ruff/0.4.10.svg)](https://pypi.python.org/pypi/ruff) +[![image](https://img.shields.io/pypi/v/ruff/0.7.4.svg)](https://pypi.python.org/pypi/ruff) +[![image](https://img.shields.io/pypi/l/ruff/0.7.4.svg)](https://pypi.python.org/pypi/ruff) +[![image](https://img.shields.io/pypi/pyversions/ruff/0.7.4.svg)](https://pypi.python.org/pypi/ruff) [![Actions status](https://github.com/astral-sh/ruff-pre-commit/workflows/main/badge.svg)](https://github.com/astral-sh/ruff-pre-commit/actions) A [pre-commit](https://pre-commit.com/) hook for [Ruff](https://github.com/astral-sh/ruff). @@ -17,9 +17,10 @@ To run Ruff's [linter](https://docs.astral.sh/ruff/linter) and [formatter](https (available as of Ruff v0.0.289) via pre-commit, add the following to your `.pre-commit-config.yaml`: ```yaml +repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.4.10 + rev: v0.7.4 hooks: # Run the linter. - id: ruff @@ -30,9 +31,10 @@ To run Ruff's [linter](https://docs.astral.sh/ruff/linter) and [formatter](https To enable lint fixes, add the `--fix` argument to the lint hook: ```yaml +repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.4.10 + rev: v0.7.4 hooks: # Run the linter. - id: ruff @@ -41,20 +43,21 @@ 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 +repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.4.10 + rev: v0.7.4 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 diff --git a/pyproject.toml b/pyproject.toml index eac6dc3..959c7ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ name = "ruff-pre-commit" version = "0.0.0" dependencies = [ - "ruff==0.4.10", + "ruff==0.7.4", ] [project.optional-dependencies]