-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
261 lines (249 loc) · 7.45 KB
/
.pre-commit-config.yaml
File metadata and controls
261 lines (249 loc) · 7.45 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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
---
default_install_hook_types: [pre-commit, pre-push]
default_stages: [pre-commit, manual]
minimum_pre_commit_version: 3.5.0
fail_fast: true
repos:
- repo: local
hooks:
- id: v8r
name: v8r
entry: npx -y v8r --ci .v8rrc.yaml
language: system
pass_filenames: true
stages: [pre-commit, pre-push, manual]
files: |
(?x)(
\.(yaml|yml|json)$
)
exclude: |
(?x)(
^configs/site-config\.yaml$|
^bash-tools-framework-schema\.json$|
^\.?secretlintrc\.yml$|
^\.vscode/|
^\.?checkov\.yml$|
^\.?secretlintrc\.json$|
^\.?grype\.yaml$|
^\.?trivy\.yaml$|
/testsData/
)
- repo: local
hooks:
# generate mermaid help with npx and save it in a file to be used in doc generation
# mermaid binary will still use npx to get the help content at runtime,
# This avoids having to install node and mermaid in docker image
- id: generate-mermaid-help
name: generate mermaid help
entry: bash -o pipefail -c 'exec npx -y @mermaid-js/mermaid-cli --help > src/_binaries/mermaid/mermaid-help.txt'
language: system
pass_filenames: false
stages: [pre-commit]
- id: generate-rimage-help
name: generate rimage help
entry: |
bash -o pipefail -c 'rimage --help | sed -E -e "s/[[:space:]]+$//" \
>src/_binaries/rimageWrapper/rimage-help.txt'
language: system
pass_filenames: false
stages: [pre-commit]
- id: generate-kroki-help
name: generate kroki help
entry: |
bash -o pipefail -c 'kroki --help | sed -E -e "s/[[:space:]]+$//" \
>src/_binaries/krokiWrapper/kroki-help.txt'
language: system
pass_filenames: false
stages: [pre-commit]
- repo: https://github.com/executablebooks/mdformat
# Do this before other tools "fixing" the line endings
rev: 0.7.22
hooks:
- id: mdformat
name: Format Markdown
entry: mdformat # Executable to run, with fixed options
language: python
types: [markdown]
args: [--wrap, "120", --number]
additional_dependencies:
- mdformat-frontmatter
- mdformat-toc
- mdformat-shfmt
- mdformat-tables
- mdformat-config
- mdformat-web
- mdformat-gfm
exclude: |
(?x)(
^\.github/
)
- repo: https://github.com/jsh9/markdown-heading-numbering
rev: 0.1.0
hooks:
- id: markdown-heading-numbering
args:
- --start-from-level=2
- --initial-numbering=1
exclude: |
(?x)(
^\.github/|
^doc/ai/|
AGENTS\.md|
commit-msg-template\.md
)
- repo: https://github.com/jsh9/markdown-toc-creator
rev: 0.1.3
hooks:
- id: markdown-toc-creator
args:
- --proactive=False
- --style=github
- --quiet
- --add-toc-title=False
- --add-horizontal-rules=False
exclude: |
(?x)(
^\.github/|
^doc/ai/|
AGENTS\.md
)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: mixed-line-ending
- id: end-of-file-fixer
exclude: |
(?x)(
^doc/images/.*\.svg$|
testsData/.*\.result$
)
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: check-xml
- id: check-merge-conflict
- id: detect-private-key
- id: fix-byte-order-marker
- id: check-yaml
- id: trailing-whitespace
exclude: |
(?x)(
testsData/
)
stages: [pre-commit, pre-push, manual]
- id: check-added-large-files
- id: forbid-new-submodules
- id: mixed-line-ending
args: [--fix=lf]
- id: check-json
# x modifier: extended. Spaces and text after a # in the pattern are ignored
exclude: |
(?x)(
.vscode\/.*\.json$
)
- repo: https://github.com/rhysd/actionlint
rev: v1.7.12
hooks:
- id: actionlint
stages: [pre-commit, pre-push, manual]
- repo: https://github.com/codespell-project/codespell
rev: v2.4.2
hooks:
- id: codespell
args:
- --dictionary
- "-"
- --dictionary
- .cspell/codespellrc-dic.txt
- --ignore-words
- .cspell/codespellrc-ignore.txt
- --quiet-level
- "2"
- --interactive
- "0"
- --check-filenames
- --check-hidden
- --write-changes
exclude: >
(?x)(
^installScripts/|
^bin/|
^install$|
^distro$|
^srcAlt|
^.cspell/codespellrc-.*.txt$
)
- repo: https://github.com/fchastanet/jumanjihouse-pre-commit-hooks
rev: 3.0.2
hooks:
- id: shfmt
args: [-i, "2", -ci]
# x modifier: extended. Spaces and text after a # in the pattern are ignored
exclude: |
(?x)(
^vendor/|
^bin/|
^manualTests/data/|
/testsData/
)
# Check both committed and uncommitted files for git conflict
# markers and whitespace errors according to core.whitespace
# and conflict-marker-size configuration in a git repo.
- id: git-check
# x modifier: extended. Spaces and text after a # in the pattern are ignored
exclude: |
(?x)(
/testsData/
)
- repo: https://github.com/fchastanet/bash-tools-framework
rev: 6.3.0
hooks:
- id: fixShebangExecutionBit
- id: awkLint
- id: shellcheckLint
- id: hugoUpdateLastmod
stages: [pre-commit]
- repo: local
hooks:
- id: frameworkLint
name: Bash Framework Lint
description: |
Check if your files uses the right syntax
for using bash-tools-framework
language: script
entry: bin/frameworkLint
args: [--expected-warnings-count, "61", --format, plain, --theme, default-force]
pass_filenames: false
types: ["executable", "file", "shell", "text"]
always_run: false
stages: [pre-commit]
- id: buildDocFilesForGithubActions
name: build doc files for github actions
language: script
entry: bin/doc
args: [--verbose, --ci]
pass_filenames: false
require_serial: true
stages: [] # GITHUB
- id: cspellForbidden
name: cspell with support to Forbidden Words
description: ensure .cspell/forbidden.txt exists and is used by cspell
language: script
entry: bin/cspellForbidden
args: []
pass_filenames: false
always_run: true
stages: [pre-commit, pre-push]
- id: plantuml
name: Plantuml Converter
description: Convert plantuml files to images
language: script
entry: bin/plantuml
args: [--ci, --same-dir, -f, svg]
pass_filenames: true
types: ["file", "non-executable", "plantuml", "text"]
always_run: false
stages: [pre-commit, manual]
- repo: https://github.com/fchastanet/bash-compiler
rev: 3.2.1
hooks:
- id: buildBashBinaries