generated from onedr0p/cluster-template
-
Notifications
You must be signed in to change notification settings - Fork 8
/
.pre-commit-config.yaml
159 lines (158 loc) · 4.33 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
---
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: |
(?x)^(
^.*(copier-answers\.ya?ml)$
)$
repos:
- repo: local
hooks:
- id: forbid-yml
name: Forbid .yml file extensions (use .yaml)
entry: YAML file extensions must be .yaml
language: fail
files: \.yml$
exclude: |
(?x)^(
^.*(copier-answers\.ya?ml)$
)$
- id: forbid-rej
name: Forbid .rej file extensions from `copier update`
entry: Forbid .rej file extensions from `copier update`
language: fail
files: \.rej$
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v5.0.0"
hooks:
- id: check-added-large-files
args: [--maxkb=500000]
stages: [commit]
- id: check-case-conflict
stages: [commit]
- id: check-merge-conflict
stages: [commit]
- id: check-ast
stages: [commit]
- id: check-json
stages: [commit]
- id: check-toml
stages: [commit]
# - id: check-yaml
# stages: [commit]
- id: end-of-file-fixer
stages: [commit]
- id: mixed-line-ending
stages: [commit]
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
stages: [commit]
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: "v1.5.5"
hooks:
- id: remove-crlf
stages: [commit]
# - id: remove-tabs
# stages: [commit]
- repo: https://github.com/sirosen/texthooks
rev: "0.6.7"
hooks:
- id: fix-smartquotes
stages: [commit]
- id: fix-ligatures
stages: [commit]
- repo: https://github.com/zricethezav/gitleaks
rev: "v8.21.2"
hooks:
- id: gitleaks
- repo: https://github.com/onedr0p/sops-pre-commit
rev: v2.1.1
hooks:
- id: forbid-secrets
args: [-h, "**/*.sops.yaml"]
# note: this only checks specific files for secrets!
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: "3.0.3"
hooks:
- id: editorconfig-checker
name: Check editorconfig compliance
exclude: |
(?x)^(
# these file types may have nonstandard indents
^(LICENSE)$ |
^.*(\.md)$ |
^.*(\.rst)$
)$
stages: [commit]
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: "v0.42.0"
hooks:
- id: markdownlint
name: Lint markdown files
args:
- --config=.markdownlint.yaml
- --fix
stages: [commit]
- repo: local
hooks:
- id: prettier
name: Format with Prettier
language: system
entry: prettier
args:
- --write
- --ignore-unknown
- --no-error-on-unmatched-pattern
# - "--ignore-path '**/*.md'"
# - "--ignore-path '**/*.y*ml'"
stages: [commit]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.7.4"
hooks:
- id: ruff
name: Lint and Format with Ruff
args: [--fix]
stages: [commit]
- repo: local
hooks:
- id: shellcheck
name: Lint shell scripts
language: system
entry: shellcheck
types: ["shell"]
exclude: "^.*zsh$" # ignore '*.zsh" scripts'
stages: [commit]
- repo: https://github.com/scop/pre-commit-shfmt
rev: "v3.8.0-1"
hooks:
- id: shfmt
name: Format shell scripts
args:
- -i
- "2"
- -ci
- -bn
stages: [commit]
### NOTE: ".typos.toml" may be required to have _already been committed_
### in order for typos pre-commit hook to read it.
### In this case, comment out this block until ".typos.toml" has been committed successfully
- repo: https://github.com/crate-ci/typos
rev: "v1.27.3"
hooks:
- id: typos
name: Spellcheck with Typos
args: ["--config", ".typos.toml"]
exclude: |
(?x)^(
^.*(\.typos\.toml)$ |
^.*(\.sops\.yaml)$ |
^.*(\.git.*)$
)$
stages: [commit]
- repo: https://github.com/adrienverge/yamllint.git
rev: "v1.35.1"
hooks:
- id: yamllint
name: Lint yaml files
args: [-c=.yamllint.yaml]
stages: [commit]