From 39f54b73c72a16ee873859353d1ef40552a22e4d Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Tue, 13 May 2025 14:16:04 +0100 Subject: [PATCH 1/2] Add and prefer the `ruff-check` pre-commit ID (#124) ## Summary Towards #123. Introduces the `ruff-check` pre-commit hook ID, updates documentation to prefer it, but retains the `ruff` ID for compatibility. --- .pre-commit-hooks.yaml | 20 ++++++++++++++++---- README.md | 6 +++--- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 491cc71..4d17023 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -1,6 +1,6 @@ -- id: ruff - name: ruff - description: "Run 'ruff' for extremely fast Python linting" +- id: ruff-check + name: ruff check + description: "Run 'ruff check' for extremely fast Python linting" entry: ruff check --force-exclude language: python types_or: [python, pyi, jupyter] @@ -10,7 +10,7 @@ minimum_pre_commit_version: "2.9.2" - id: ruff-format - name: ruff-format + name: ruff format description: "Run 'ruff format' for extremely fast Python formatting" entry: ruff format --force-exclude language: python @@ -19,3 +19,15 @@ require_serial: true additional_dependencies: [] minimum_pre_commit_version: "2.9.2" + +# Legacy alias +- id: ruff + name: ruff (legacy alias) + description: "Run 'ruff check' for extremely fast Python linting" + entry: ruff check --force-exclude + language: python + types_or: [python, pyi, jupyter] + args: [] + require_serial: true + additional_dependencies: [] + minimum_pre_commit_version: "2.9.2" diff --git a/README.md b/README.md index adfe482..f55e273 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ repos: rev: v0.11.9 hooks: # Run the linter. - - id: ruff + - id: ruff-check # Run the formatter. - id: ruff-format ``` @@ -37,7 +37,7 @@ repos: rev: v0.11.9 hooks: # Run the linter. - - id: ruff + - id: ruff-check args: [ --fix ] # Run the formatter. - id: ruff-format @@ -52,7 +52,7 @@ repos: rev: v0.11.9 hooks: # Run the linter. - - id: ruff + - id: ruff-check types_or: [ python, pyi ] args: [ --fix ] # Run the formatter. From 12753357c00c3fb8615100354c9fdc6ab80b044d Mon Sep 17 00:00:00 2001 From: charliermarsh Date: Thu, 15 May 2025 14:15:07 +0000 Subject: [PATCH 2/2] Mirror: 0.11.10 --- README.md | 12 ++++++------ pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f55e273..a03dde3 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.11.9.svg)](https://pypi.python.org/pypi/ruff) -[![image](https://img.shields.io/pypi/l/ruff/0.11.9.svg)](https://pypi.python.org/pypi/ruff) -[![image](https://img.shields.io/pypi/pyversions/ruff/0.11.9.svg)](https://pypi.python.org/pypi/ruff) +[![image](https://img.shields.io/pypi/v/ruff/0.11.10.svg)](https://pypi.python.org/pypi/ruff) +[![image](https://img.shields.io/pypi/l/ruff/0.11.10.svg)](https://pypi.python.org/pypi/ruff) +[![image](https://img.shields.io/pypi/pyversions/ruff/0.11.10.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). @@ -20,7 +20,7 @@ To run Ruff's [linter](https://docs.astral.sh/ruff/linter) and [formatter](https repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.11.9 + rev: v0.11.10 hooks: # Run the linter. - id: ruff-check @@ -34,7 +34,7 @@ To enable lint fixes, add the `--fix` argument to the lint hook: repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.11.9 + rev: v0.11.10 hooks: # Run the linter. - id: ruff-check @@ -49,7 +49,7 @@ To avoid running on Jupyter Notebooks, remove `jupyter` from the list of allowed repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.11.9 + rev: v0.11.10 hooks: # Run the linter. - id: ruff-check diff --git a/pyproject.toml b/pyproject.toml index e1f37e4..527e75b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,5 +2,5 @@ name = "ruff-pre-commit" version = "0.0.0" dependencies = [ - "ruff==0.11.9", + "ruff==0.11.10", ]