Skip to content

Commit 836250e

Browse files
committed
Add 'pyproject' to types_or for ruff checks
1 parent 1629a02 commit 836250e

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.pre-commit-hooks.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
description: "Run 'ruff check' for extremely fast Python linting"
44
entry: ruff check --force-exclude
55
language: python
6-
types_or: [python, pyi, jupyter]
6+
types_or: [python, pyi, jupyter, pyproject]
77
args: []
88
require_serial: true
99
additional_dependencies: []
@@ -26,7 +26,7 @@
2626
description: "Run 'ruff check' for extremely fast Python linting"
2727
entry: ruff check --force-exclude
2828
language: python
29-
types_or: [python, pyi, jupyter]
29+
types_or: [python, pyi, jupyter, pyproject]
3030
args: []
3131
require_serial: true
3232
additional_dependencies: []

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ repos:
4343
- id: ruff-format
4444
```
4545

46+
By default, `ruff-check` applies to Python files, stub files, Jupyter Notebooks, and `pyproject.toml`.
47+
`ruff-format` applies to Python files, stub files, and Jupyter Notebooks.
48+
4649
To avoid running on Jupyter Notebooks, remove `jupyter` from the list of allowed filetypes:
4750

4851
```yaml
@@ -53,7 +56,7 @@ repos:
5356
hooks:
5457
# Run the linter.
5558
- id: ruff-check
56-
types_or: [ python, pyi ]
59+
types_or: [ python, pyi, pyproject ]
5760
args: [ --fix ]
5861
# Run the formatter.
5962
- id: ruff-format
@@ -82,7 +85,7 @@ repo = "https://github.com/astral-sh/ruff-pre-commit"
8285
rev = "v0.15.0" # Ruff version.
8386
hooks = [
8487
# Run the linter.
85-
{ id = "ruff-check", args = ["--fix"], types_or = ["python", "pyi"] },
88+
{ id = "ruff-check", args = ["--fix"], types_or = ["python", "pyi", "pyproject"] },
8689
8790
# Run the formatter.
8891
{ id = "ruff-format", types_or = ["python", "pyi"] },

0 commit comments

Comments
 (0)