forked from ansible/vscode-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
180 lines (177 loc) · 5.4 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
---
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: 2.9.0 # types_or
repos:
- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v8.13.3
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
args:
- --color=always
- -e
- SC1091
- 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
verbose: true # do not remove, as this allows warnings to be displayed on GHA
args:
# default format is not vscode friendly
- --no-warn-ignored
- --color
- --format=gha
- --format=unix
- --fix
# - --max-warnings
# - "0"
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: v4.6.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
)$
- 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.41.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.17.0
hooks:
- id: commitlint
stages: [commit-msg]