-
Notifications
You must be signed in to change notification settings - Fork 92
/
.pre-commit-config.yaml
196 lines (193 loc) · 5.93 KB
/
.pre-commit-config.yaml
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
---
ci:
# format compatible with commitlint
autoupdate_commit_msg: "chore: pre-commit autoupdate"
autoupdate_schedule: monthly
autofix_commit_msg: |
chore: auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
skip:
#- yarn-audit
#- yarn-audit-fix
- yarn-dedupe
- codecov
- depcheck
- eslint
exclude: >
(?x)^(
.config/requirements.in|
.*.svg
)$
minimum_pre_commit_version: 4.0.0 # Related to https://github.com/ekalinin/nodeenv/issues/369
repos:
- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v8.15.2
hooks:
- id: cspell
# name: Spell check with cspell
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
pass_filenames: false # we want to use its own config
additional_dependencies:
- tomli
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
# https://github.com/shellcheck-py/shellcheck-py/issues/132
language_version: python3.12
args:
- --color=always
- -e
- SC1091
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.2
hooks:
- id: ruff
args:
- --fix
- --exit-non-zero-on-fix
types_or: [python, pyi]
- id: ruff-format # must be after ruff
types_or: [python, pyi]
- repo: https://github.com/psf/black # must be after ruff
rev: 24.10.0
hooks:
- id: black
- repo: local
hooks:
- id: depcheck
name: depcheck
entry: yarn dlx depcheck
language: system
pass_filenames: false
always_run: true
- id: eslint
name: eslint
entry: npx eslint
language: system
args:
- --no-warn-ignored
- --color
- --format=gha
- --fix
- --cache
- --max-warnings
- "0"
pass_filenames: false
files: \.m?[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
types: [file]
- id: git-dirty
name: Check if git reports dirty
entry: git diff --exit-code
language: system
pass_filenames: false
always_run: true
# - id: yarn-audit-fix
# name: yarn-audit-fix
# language: system
# pass_filenames: false
# files: \.tool-versions|package\.json|yarn(-.*\.cjs|\.lock)
# entry: npx yarn run yarn-audit-fix
- id: codecov
name: Check codecov.yml
# https://superuser.com/a/1587813/3004
entry: >
bash -c '[ $(
curl --silent -o /dev/stderr -w "%{http_code}" -X POST
--data-binary @codecov.yml https://codecov.io/validate
) -eq 200 ]'
language: system
files: "codecov.yml"
pass_filenames: false
- repo: https://github.com/ScribeMD/pre-commit-hooks
rev: 0.16.3
hooks:
- id: yarn-dedupe
entry: npx yarn dedupe
# - id: yarn-audit
# entry: npx yarn npm audit
- repo: https://github.com/pre-commit/pre-commit-hooks.git
rev: v5.0.0
hooks:
- id: end-of-file-fixer
exclude: >
(?x)^(
docs/als/settings.md
)$
- id: trailing-whitespace
exclude: >
(?x)^(
.yarn/.*|
examples/playbooks/(with-skip-tag-id|unicode).yml|
examples/playbooks/example.yml|
docs/als/settings.md
)$
- id: mixed-line-ending
- id: check-byte-order-marker
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-json
# does not support JSON with comments
exclude: >
(?x)^(
.vscode/settings.json|
jinja-language-configuration.json|
ansible-language-configuration.json|
packages/ansible-language-server/.vscode/.*|
packages/ansible-language-server/scripts/tsconfig.json|
packages/ansible-language-server/scripts/tsconfig.esm.json|
packages/ansible-language-server/scripts/tsconfig.umd.json|
packages/ansible-language-server/tsconfig.json|
test/units/lightspeed/utils/samples/collections/ansible_collections/community/broken_MANIFEST/MANIFEST.json
)$
- id: debug-statements
language_version: python3
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.35.1
hooks:
- id: yamllint
files: \.(yaml|yml)$
types: [file, yaml]
entry: yamllint --strict
exclude: >
(?x)^(
test/testFixtures/diagnostics/yaml/invalid_yaml.yml|
packages/ansible-language-server/test/testFixtures/diagnostics/yaml/invalid_yaml.yml|
packages/ansible-language-server/test/fixtures/diagnostics/invalid_yaml.yml
)$
- repo: https://github.com/pycontribs/mirrors-prettier
# keep it before markdownlint and eslint
rev: "v3.3.3"
hooks:
- id: prettier
types_or: ["markdown", "json", "ts"]
exclude: >
(?x)^(
jinja-language-configuration.json|
syntaxes/external/jinja.tmLanguage.json|
docs/als/settings.md
)$
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.42.0
hooks:
- id: markdownlint
exclude: >
(?x)^
docs/als/settings.md|
docs/development/additional_resources.md|
docs/development/debug_extension.md|
docs/development/extension_code_structure.md|
docs/development/main.md|
docs/development/project_structure.md|
docs/development/server_code_structure.md|
docs/development/test_code.md|
docs/development/webview_guide.md
$
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.18.0
hooks:
- id: commitlint
stages: [commit-msg]