-
Notifications
You must be signed in to change notification settings - Fork 114
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
65 lines (59 loc) · 2.51 KB
/
.pre-commit-config.yaml
File metadata and controls
65 lines (59 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
exclude: ^(scratchpad/)
repos:
- repo: local
hooks:
# Moving ruff hooks to the local version allows for different behavior locally and in ci/cd pipelines.
- id: ruff-format
name: "Ruff formatter"
entry: bash -c 'if [ "$CICD" = "1" ]; then ruff format --check --diff --quiet --config=pyproject.toml "$@"; else ruff format --quiet --config=pyproject.toml "$@"; fi' --
language: system
types_or: [python, jupyter]
- id: ruff
name: "Ruff linter"
entry: bash -c 'if [ "$CICD" = "1" ]; then ruff check --no-fix --show-fixes --quiet --config=pyproject.toml "$@"; else ruff check --exit-non-zero-on-fix --fix --quiet --config=pyproject.toml "$@"; fi' --
language: system
types_or: [python, jupyter]
- repo: local
hooks:
- id: mypy
name: MyPy
entry: uv run --no-sync mypy --install-types --non-interactive .
pass_filenames: false
language: system
types_or: [python, jupyter]
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.7.8
hooks:
- id: uv-lock
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
additional_dependencies:
- tomli
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.44.0
hooks:
- id: markdownlint
name: markdownlint (docs)
args: [--config, docs/docs/.markdownlint.json]
files: ^docs/docs/.*\.md$
# Docs validation hooks — skip gracefully when generated docs are not present
- repo: local
hooks:
- id: docs-mdx-validate
name: Validate generated MDX docs
entry: bash -c 'test -d docs/docs/api && uv run --no-sync python tooling/docs-autogen/validate.py docs/docs/api --skip-coverage --warn-only || true'
language: system
pass_filenames: false
files: (docs/docs/.*\.mdx$|tooling/docs-autogen/)
# Docstring quality gate — manual only (CI is the hard gate via docs-publish.yml).
# Run locally with: pre-commit run docs-docstring-quality --hook-stage manual
# Requires generated API docs (run `uv run python tooling/docs-autogen/build.py` first).
- id: docs-docstring-quality
name: Audit docstring quality
entry: uv run --no-sync python tooling/docs-autogen/audit_coverage.py --quality --fail-on-quality --threshold 0 --docs-dir docs/docs/api
language: system
pass_filenames: false
files: (mellea/.*\.py$|cli/.*\.py$)
stages: [manual]