-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
126 lines (113 loc) · 4 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
126 lines (113 loc) · 4 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-added-large-files
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.11.28
hooks:
- id: uv-lock
# Docformatter: format docstrings and make sure we use 100 columns.
# See [tool.docformatter] in pyproject.toml. Must run before ruff.
# Excluded files:
# - errors.py: blank-line conflict with Ruff
# - test_locking.py: docformatter mistakes the indented triple-quoted docstring
# Drop this exclusion once https://github.com/PyCQA/docformatter/issues/344 is fixed.
# - telemetry/dashboard.py: a marimo notebook full of mo.md("""...""") calls; docformatter
# treats those markdown strings as docstrings and reflows them destructively. Ruff formats it.
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.8
hooks:
- id: docformatter
args: [--in-place, --config, ./pyproject.toml]
exclude: ^(src/photo_tagger/errors\.py|tests/test_locking\.py|telemetry/dashboard\.py)$
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.20
hooks:
- id: ruff-check
args: [--fix]
- id: ruff-format
- repo: https://github.com/hukkin/mdformat
rev: 1.0.0
hooks:
- id: mdformat
exclude: ^docs/ # docs/ uses the mkdocs flavor below
additional_dependencies:
- mdformat-gfm # GitHub Flavored Markdown support
- mdformat-frontmatter # Don't mess with YAML front matter blocks
- id: mdformat
name: mdformat (docs)
files: ^docs/ # Zensical sources: admonitions and content tabs need the mkdocs plugin
additional_dependencies:
- mdformat-mkdocs # MkDocs/Material syntax (admonitions, content tabs, 4-space lists)
- mdformat-frontmatter # Don't mess with YAML front matter blocks
- repo: https://github.com/PyCQA/bandit
rev: 1.9.4
hooks:
- id: bandit
args: ["-c", "pyproject.toml"]
additional_dependencies: ["bandit[toml]"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.21.2
hooks:
- id: pyupgrade
args: [--py314-plus]
- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v10.0.1
hooks:
- id: cspell # Spell check changed files
- id: cspell # Spell check the commit message
name: check commit message spelling
args:
- --no-must-find-files
- --no-progress
- --no-summary
- --files
- .git/COMMIT_EDITMSG
stages: [commit-msg]
always_run: true
- repo: https://github.com/crate-ci/typos
rev: v1.48.0
hooks:
- id: typos
# Renovate config validator. Catches a typo in renovate.json5 before it silently breaks updates.
- repo: https://github.com/renovatebot/pre-commit-hooks
rev: 43.256.2
hooks:
- id: renovate-config-validator
args: [--strict]
- repo: local
hooks:
- id: zuban
name: zuban type check
entry: zuban check
language: system
types: [python]
pass_filenames: true
always_run: true
- id: pycroscope
name: pycroscope static analysis
entry: uv run pycroscope --config-file pyproject.toml
language: system
types: [python]
pass_filenames: false
require_serial: true
always_run: true
- id: check-version-sync
name: check version sync
entry: uv run scripts/check_version_sync.py
language: system
pass_filenames: false
files: (pyproject\.toml|uv\.lock|SECURITY\.md|CHANGELOG\.md)
- id: check-translations
name: check compiled translations
entry: uv run scripts/compile_translations.py --check
language: system
pass_filenames: false
files: \.(po|pot|mo)$|compile_translations\.py$