-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
196 lines (196 loc) · 5.73 KB
/
.pre-commit-config.yaml
File metadata and controls
196 lines (196 loc) · 5.73 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-xml
- id: check-toml
- id: check-merge-conflict
- id: check-json
- id: mixed-line-ending
args: [--fix=lf]
- id: pretty-format-json
args: [--no-sort-keys, --autofix, --no-ensure-ascii]
exclude: ^weblate/trans/fixtures/simple-project.json|weblate/trans/tests/data/.*.json$
- repo: https://github.com/adamchainz/django-upgrade
rev: 1.30.0
hooks:
- id: django-upgrade
- repo: https://github.com/adamchainz/djade-pre-commit
rev: 1.9.0
hooks:
- id: djade
types_or: [html, text]
files: ^weblate/.*templates/.*\.(txt|html|tmx)$
- repo: https://github.com/adrienverge/yamllint
rev: v1.38.0
hooks:
- id: yamllint
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.9
hooks:
- id: ruff-check
args:
- --fix
- --exit-non-zero-on-fix
- id: ruff-format
- repo: https://github.com/adamtheturtle/doccmd-pre-commit
rev: v2026.3.2
hooks:
- id: doccmd
args: [--language, python, --no-pad-file, --command, ruff format]
additional_dependencies:
- ruff==0.15.9
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.16.0
hooks:
- id: pretty-format-yaml
args: [--autofix, --indent, '2']
- repo: https://github.com/pappasam/toml-sort
rev: v0.24.4
hooks:
- id: toml-sort-fix
- repo: https://github.com/executablebooks/mdformat
rev: 1.0.0
hooks:
- id: mdformat
additional_dependencies:
- mdformat-gfm==1.0.0
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.13.0-1
hooks:
- id: shfmt
args: [--write]
- repo: https://github.com/fsfe/reuse-tool
rev: v6.2.0
hooks:
- id: reuse
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.11.0.1
hooks:
- id: shellcheck
require_serial: true
- repo: https://github.com/biomejs/pre-commit
rev: v2.4.10
hooks:
- id: biome-check
args: [--error-on-warnings]
additional_dependencies:
- '@biomejs/biome@2.4.10'
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.25
hooks:
- id: validate-pyproject
- repo: https://github.com/djlint/djLint
rev: v1.36.4
hooks:
- id: djlint-reformat-django
types_or: [html, text]
files: ^weblate/.*templates/.*\.(txt|html|tmx)$
- id: djlint-django
types_or: [html, text]
files: ^weblate/.*templates/.*\.(txt|html|tmx)$
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: rst-directive-colons
- id: rst-inline-touching-normal
- repo: local
hooks:
- id: rst-double-space
name: rst text with double space
description: Detect mistake of rst containing double space
types: [rst]
entry: \S +(?![\| +])
language: pygrep
exclude: docs/devel/reporting-example.rst|docs/admin/addons.rst|docs/snippets/file-format-parameters.rst|docs/snippets/addons-autogenerated.rst
- id: rst-http
name: http link in rst text
description: Detect mistake of using http links
types: [rst]
entry: http://(?!example\.|[a-z]*\.example\.|weblate:|localhost|anubis|127\.0\.0\.1|user:password@proxy|libretranslate:)
language: pygrep
- id: rst-bullet-stop
name: Changes end with a stop
description: Bullet list in changes should end with a stop.
files: docs/changes\.rst
entry: ^ *\* .*[^.]\n$
language: pygrep
- id: rst-seealso-inline
name: seealso should use block
types: [rst]
entry: '^\.\. seealso:: .*$'
language: pygrep
- id: rst-seealso-list
name: seealso should use list for multiple lines
types: [rst]
args: [--multiline]
entry: ^\.\. seealso::\n\n( *[:`*][^\n]*\n)* *[:`*][^\n]*,
language: pygrep
- id: py-join-comma
name: Localized comma in join
types: [python]
args: [--multiline]
entry: format_html_join\(\s*", "
language: pygrep
- id: py-format-html-join-comma
name: Percent format with format_html_join_comma leads to double escaping
types: [python]
entry: '% format_html_join_comma'
language: pygrep
- id: py-lazy-format
name: Formatting a lazy translation
types: [python]
args: [--multiline]
entry: gettext_lazy\([^\)]*\)(\s*%|.format\()
language: pygrep
- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: v1.0.2
hooks:
- id: sphinx-lint
- repo: https://github.com/codespell-project/codespell
rev: v2.4.2
hooks:
- id: codespell
additional_dependencies:
- tomli
exclude: client/yarn.lock
- repo: https://github.com/crate-ci/typos
rev: v1.45.0
hooks:
- id: typos
args: []
require_serial: true
pass_filenames: false
- repo: https://github.com/rhysd/actionlint
rev: v1.7.12
hooks:
- id: actionlint
- repo: https://github.com/zizmorcore/zizmor-pre-commit
rev: v1.23.1
hooks:
- id: zizmor
- repo: https://github.com/docker-compose-linter/pre-commit-dclint
rev: v3.1.0
hooks:
- id: dclint
files: ^.*/(docker-)?compose(-.*)?\.ya?ml$
- repo: https://github.com/mongodb/kingfisher
rev: v1.93.0
hooks:
- id: kingfisher-auto
args: [--exclude, weblate/trans/tests/data/googlev3.json, --exclude, docs/]
exclude: ^.*\.(csv|svg|wsdl(\.[^.]*)?)|weblate/trans/tests/data/memory-broken\.json|weblate/templates/browserconfig\.xml|weblate/templates/configuration/custom\.css|weblate/trans/tests/data/cs-CZ\.rc|weblate/static/vendor/.*|weblate/static/js/vendor/.*|weblate/static/styles/vendor/.*|docs/make\.bat|weblate/templates/addons/js/weblate\.js|uv\.lock|docs/specs/openapi.yaml$
ci:
autoupdate_schedule: quarterly
skip:
- reuse
- kingfisher-auto