-
-
Notifications
You must be signed in to change notification settings - Fork 450
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
98 lines (95 loc) · 3.53 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
98 lines (95 loc) · 3.53 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
ci:
autoupdate_commit_msg: "chore: update pre-commit hooks"
autoupdate_schedule: "monthly"
autofix_prs: false
# Both of these are `language: system` hooks that shell out to the local
# toolchain — `uv` for mypy, `uv` and `just` for the docs build — and need
# the repo checkout to resolve their environments from `uv.lock`. Neither is
# available on pre-commit.ci's runners. Each is covered instead by a GitHub
# Actions job (Lint for mypy, zarr-http-server for the docs build) and by
# local prek runs.
skip: [mypy, zarr-http-server-docs]
default_stages: [pre-commit, pre-push]
default_language_version:
python: python3.12
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.16.0
hooks:
- id: ruff-check
args: ["--fix", "--show-fixes"]
- id: ruff-format
- repo: https://github.com/codespell-project/codespell
rev: v2.4.2
hooks:
- id: codespell
args: ["-L", "fo,ihs,kake,te", "-S", "fixture"]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-yaml
exclude: mkdocs.yml
- id: trailing-whitespace
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.22.1
hooks:
# Markdown structure/hygiene. Rule selection and ignores are in
# .markdownlint-cli2.jsonc; complements ci/lint_docs.py (RST residue,
# list-breaking fences) and `mkdocs build --strict`. Scoped to docs/ to
# match the config's globs (pre-commit passes filenames, which would
# otherwise override that scoping and lint all repo Markdown).
- id: markdownlint-cli2
files: ^docs/
- repo: local
hooks:
- id: mypy
name: mypy
language: system
entry: uv run --frozen mypy
pass_filenames: false
always_run: true
types_or: [python, pyi]
# Builds the zarr-http-server docs site with warnings as errors, which
# catches a dead cross-reference or a nav entry pointing at a file that
# no longer exists before it reaches CI.
#
# `stages: [pre-push]` overrides the default of running on every commit:
# this is a whole-site build, too slow to pay per commit and only
# actionable before the code leaves the machine. `files:` limits it to
# changes that touch the package, and `pass_filenames: false` because
# mkdocs builds the site, not a list of files. Delegating to the
# justfile keeps one definition of the build shared with CI.
- id: zarr-http-server-docs
name: zarr-http-server docs build
language: system
entry: >-
just --justfile packages/zarr-http-server/justfile
--working-directory packages/zarr-http-server docs-check
pass_filenames: false
files: ^packages/zarr-http-server/
stages: [pre-push]
- repo: https://github.com/scientific-python/cookie
rev: 2026.06.18
hooks:
- id: sp-repo-review
- repo: https://github.com/numpy/numpydoc
rev: v1.11.0rc0
hooks:
- id: numpydoc-validation
- repo: local
hooks:
- id: ban-lstrip-rstrip
name: ban lstrip/rstrip
language: pygrep
# Matches .lstrip() or .rstrip() where the string argument is 2+ characters.
entry: "\\.(lstrip|rstrip)\\([\"'][^\"']{2,}[\"']\\)"
types: [python]
files: ^(src|tests)/
- repo: https://github.com/zizmorcore/zizmor-pre-commit
rev: v1.26.1
hooks:
- id: zizmor
- repo: https://github.com/twisted/towncrier
rev: 25.8.0
hooks:
- id: towncrier-check