Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- id: ruff
name: ruff
description: "Run 'ruff' for extremely fast Python linting"
- id: ruff-check
name: ruff check
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the display name to reflect the sub-command executed.

description: "Run 'ruff check' for extremely fast Python linting"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct a likely oversight from #32

entry: ruff check --force-exclude
language: python
types_or: [python, pyi, jupyter]
Expand All @@ -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
Expand All @@ -19,3 +19,15 @@
require_serial: true
additional_dependencies: []
minimum_pre_commit_version: "2.9.2"

# Legacy alias
- id: ruff
name: ruff (legacy alias)
Comment on lines +23 to +25
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Retain the id: ruff hook ID as an alias. I've changed the name to display ruff (legacy alias), but this might be too aggressive for now -- would welcome thoughts.

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"
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repos:
rev: v0.11.8
hooks:
# Run the linter.
- id: ruff
- id: ruff-check
# Run the formatter.
- id: ruff-format
```
Expand All @@ -37,7 +37,7 @@ repos:
rev: v0.11.8
hooks:
# Run the linter.
- id: ruff
- id: ruff-check
args: [ --fix ]
# Run the formatter.
- id: ruff-format
Expand All @@ -52,7 +52,7 @@ repos:
rev: v0.11.8
hooks:
# Run the linter.
- id: ruff
- id: ruff-check
types_or: [ python, pyi ]
args: [ --fix ]
# Run the formatter.
Expand Down