|
| 1 | +default_stages: [pre-commit] |
| 2 | + |
1 | 3 | repos: |
2 | 4 | - repo: https://github.com/pre-commit/pre-commit-hooks |
3 | 5 | rev: v6.0.0 |
4 | 6 | hooks: |
| 7 | + # These are safe to run in both local & CI (they don't require "fix vs check" split) |
5 | 8 | - id: check-added-large-files |
| 9 | + stages: [pre-commit, manual] |
6 | 10 | - id: check-yaml |
| 11 | + stages: [pre-commit, manual] |
7 | 12 | - id: check-toml |
| 13 | + stages: [pre-commit, manual] |
| 14 | + - id: check-merge-conflict |
| 15 | + stages: [pre-commit, manual] |
| 16 | + |
| 17 | + # These modify files. Run locally only (pre-commit stage). |
8 | 18 | - id: end-of-file-fixer |
9 | | - - id: name-tests-test |
10 | | - args: [--pytest-test-first] |
| 19 | + stages: [pre-commit] |
11 | 20 | - id: trailing-whitespace |
12 | | - - id: check-merge-conflict |
| 21 | + stages: [pre-commit] |
| 22 | + |
13 | 23 | - repo: https://github.com/tox-dev/pyproject-fmt |
14 | 24 | rev: v2.15.2 |
15 | 25 | hooks: |
16 | 26 | - id: pyproject-fmt |
| 27 | + stages: [pre-commit] # modifies -> local only |
| 28 | + |
17 | 29 | - repo: https://github.com/abravalheri/validate-pyproject |
18 | 30 | rev: v0.25 |
19 | 31 | hooks: |
20 | 32 | - id: validate-pyproject |
| 33 | + stages: [pre-commit, manual] |
| 34 | + |
21 | 35 | - repo: https://github.com/astral-sh/ruff-pre-commit |
22 | 36 | rev: v0.15.0 |
23 | 37 | hooks: |
24 | | - # Run the formatter. |
| 38 | + # -------------------------- |
| 39 | + # LOCAL AUTOFIX (developers) |
| 40 | + # -------------------------- |
| 41 | + - id: ruff-check |
| 42 | + name: ruff-check (fix) |
| 43 | + args: [--fix, --unsafe-fixes] |
| 44 | + stages: [pre-commit] |
| 45 | + |
25 | 46 | - id: ruff-format |
26 | | - # Run the linter. |
| 47 | + name: ruff-format (write) |
| 48 | + stages: [pre-commit] |
| 49 | + |
| 50 | + # -------------------------- |
| 51 | + # CI CHECK-ONLY (no writes) |
| 52 | + # -------------------------- |
27 | 53 | - id: ruff-check |
28 | | - args: [--fix,--unsafe-fixes] |
| 54 | + name: ruff-check (ci) |
| 55 | + args: [--output-format=github] |
| 56 | + stages: [manual] |
| 57 | + |
| 58 | + - id: ruff-format |
| 59 | + name: ruff-format (ci) |
| 60 | + args: [--check, --diff] |
| 61 | + stages: [manual] |
0 commit comments