|
| 1 | +# Every Python tool here runs from the project environment through |
| 2 | +# `uv run`, so the lockfile pins one version for both this hook line and |
| 3 | +# CI. A pre-commit mirror carries its own pin that drifts from the |
| 4 | +# lockfile CI installs, and the two gates then disagree. |
| 5 | +# |
| 6 | +# actionlint is a Go binary with no lockfile entry; the CI step pins the |
| 7 | +# same 1.7.11 this mirror does. |
| 8 | +default_stages: [pre-commit] |
| 9 | + |
1 | 10 | repos: |
2 | | - - repo: https://github.com/adrienverge/yamllint |
3 | | - rev: v1.38.0 |
| 11 | + - repo: https://github.com/pre-commit/pre-commit-hooks |
| 12 | + rev: v6.0.0 |
4 | 13 | hooks: |
5 | | - - id: yamllint |
6 | | - args: [-c, .yamllint.yaml] |
| 14 | + - id: end-of-file-fixer |
| 15 | + exclude: ^(_bmad|_bmad-output|\.specify|\.claude/commands)/ |
| 16 | + - id: trailing-whitespace |
| 17 | + exclude: ^(_bmad|_bmad-output|\.specify|\.claude/commands)/ |
| 18 | + - id: check-merge-conflict |
| 19 | + - id: check-added-large-files |
| 20 | + args: [--maxkb=1024] |
7 | 21 |
|
8 | 22 | - repo: https://github.com/rhysd/actionlint |
9 | 23 | rev: v1.7.11 |
10 | 24 | hooks: |
11 | 25 | - id: actionlint |
12 | 26 |
|
13 | | - - repo: https://github.com/astral-sh/ruff-pre-commit |
14 | | - rev: v0.15.4 |
| 27 | + - repo: local |
15 | 28 | hooks: |
| 29 | + - id: yamllint |
| 30 | + name: yamllint |
| 31 | + entry: uv run yamllint -c .yamllint.yaml . |
| 32 | + language: system |
| 33 | + pass_filenames: false |
| 34 | + always_run: true |
| 35 | + |
16 | 36 | - id: ruff-check |
| 37 | + name: ruff check |
| 38 | + entry: uv run ruff check . |
| 39 | + language: system |
| 40 | + pass_filenames: false |
| 41 | + always_run: true |
| 42 | + |
17 | 43 | - id: ruff-format |
| 44 | + name: ruff format |
| 45 | + entry: uv run ruff format --check . |
| 46 | + language: system |
| 47 | + pass_filenames: false |
| 48 | + always_run: true |
18 | 49 |
|
19 | | - - repo: https://github.com/astral-sh/uv-pre-commit |
20 | | - rev: 0.10.7 |
21 | | - hooks: |
| 50 | + # `uv lock --check` reports a stale lockfile where the mirror's bare |
| 51 | + # `uv lock` rewrote it, matching CI. |
22 | 52 | - id: uv-lock |
| 53 | + name: uv lock is current |
| 54 | + entry: uv lock --check |
| 55 | + language: system |
| 56 | + pass_filenames: false |
| 57 | + files: ^(uv\.lock|pyproject\.toml|uv\.toml)$ |
23 | 58 |
|
24 | | - - repo: https://github.com/owenlamont/uv-secure |
25 | | - rev: 0.17.0 |
26 | | - hooks: |
27 | 59 | - id: uv-secure |
| 60 | + name: uv-secure |
| 61 | + entry: uv run uv-secure |
| 62 | + language: system |
| 63 | + pass_filenames: false |
| 64 | + files: ^uv\.lock$ |
28 | 65 |
|
29 | | - - repo: local |
30 | | - hooks: |
31 | 66 | - id: lint-imports |
32 | 67 | name: import-linter |
33 | 68 | entry: uv run lint-imports |
34 | 69 | language: system |
35 | | - types: [python] |
36 | 70 | pass_filenames: false |
| 71 | + always_run: true |
37 | 72 |
|
38 | 73 | - id: ty-check |
39 | 74 | name: ty type check |
40 | 75 | entry: uv run ty check src/ |
41 | 76 | language: system |
42 | | - types: [python] |
43 | 77 | pass_filenames: false |
| 78 | + always_run: true |
44 | 79 |
|
45 | 80 | - id: pytest |
46 | 81 | name: pytest |
47 | 82 | entry: uv run pytest --tb=short -q |
48 | 83 | language: system |
49 | | - types: [python] |
50 | 84 | pass_filenames: false |
| 85 | + always_run: true |
51 | 86 |
|
52 | 87 | - id: docvet |
53 | 88 | name: docvet check |
54 | 89 | entry: uv run docvet check --staged |
55 | 90 | language: system |
56 | | - types: [python] |
57 | 91 | pass_filenames: false |
| 92 | + always_run: true |
0 commit comments