|
| 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 | args: ['--maxkb=1024'] |
7 | 11 | - id: check-yaml |
| 12 | + stages: [pre-commit, manual] |
8 | 13 | - id: check-toml |
9 | | - - id: end-of-file-fixer |
| 14 | + stages: [pre-commit, manual] |
| 15 | + - id: check-merge-conflict |
| 16 | + stages: [pre-commit, manual] |
10 | 17 | - id: name-tests-test |
11 | | - args: ['--pytest-test-first'] |
| 18 | + stages: [pre-commit, manual] |
| 19 | + args: ["--pytest-test-first"] |
| 20 | + |
| 21 | + # These modify files. Run locally only (pre-commit stage). |
| 22 | + - id: end-of-file-fixer |
| 23 | + stages: [pre-commit] |
12 | 24 | - id: trailing-whitespace |
13 | | - - repo: https://github.com/astral-sh/ruff-pre-commit |
14 | | - rev: v0.15.4 |
15 | | - hooks: |
16 | | - # Run the formatter. |
17 | | - - id: ruff-format |
18 | | - # Run the linter. |
19 | | - - id: ruff-check |
20 | | - args: [--fix,--unsafe-fixes] |
| 25 | + stages: [pre-commit] |
| 26 | + |
21 | 27 | - repo: https://github.com/tox-dev/pyproject-fmt |
22 | | - rev: v2.16.2 |
| 28 | + rev: v2.21.1 |
23 | 29 | hooks: |
24 | 30 | - id: pyproject-fmt |
| 31 | + stages: [pre-commit] # modifies -> local only |
| 32 | + |
25 | 33 | - repo: https://github.com/abravalheri/validate-pyproject |
26 | 34 | rev: v0.25 |
27 | 35 | hooks: |
28 | 36 | - id: validate-pyproject |
29 | | - - repo: https://github.com/tlambert03/napari-plugin-checks |
30 | | - rev: v0.3.0 |
| 37 | + stages: [pre-commit, manual] |
| 38 | + |
| 39 | + - repo: https://github.com/astral-sh/ruff-pre-commit |
| 40 | + rev: v0.15.12 |
31 | 41 | hooks: |
32 | | - - id: napari-plugin-checks |
33 | | - # https://mypy.readthedocs.io/en/stable/introduction.html |
34 | | - # you may wish to add this as well! |
35 | | - # - repo: https://github.com/pre-commit/mirrors-mypy |
36 | | - # rev: v0.910-1 |
37 | | - # hooks: |
38 | | - # - id: mypy |
| 42 | + # -------------------------- |
| 43 | + # LOCAL AUTOFIX (developers) |
| 44 | + # -------------------------- |
| 45 | + - id: ruff-check |
| 46 | + name: ruff-check (fix) |
| 47 | + args: [--fix, --unsafe-fixes] |
| 48 | + stages: [pre-commit] |
| 49 | + |
| 50 | + - id: ruff-format |
| 51 | + name: ruff-format (write) |
| 52 | + stages: [pre-commit] |
| 53 | + |
| 54 | + # -------------------------- |
| 55 | + # CI CHECK-ONLY (no writes) |
| 56 | + # -------------------------- |
| 57 | + - id: ruff-check |
| 58 | + name: ruff-check (ci) |
| 59 | + args: [--output-format=github] |
| 60 | + stages: [manual] |
| 61 | + |
| 62 | + - id: ruff-format |
| 63 | + name: ruff-format (ci) |
| 64 | + args: [--check, --diff] |
| 65 | + stages: [manual] |
0 commit comments