-
-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
266 lines (266 loc) · 9.5 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
266 lines (266 loc) · 9.5 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
262
263
264
265
266
---
# https://pre-commit.com/#installation
default_stages: [pre-commit, pre-push]
default_language_version:
python: python3
node: 24.14.0
minimum_pre_commit_version: '3.2.0'
repos:
- repo: meta
hooks:
- id: identity
name: Run identity
description: Run the identity check
- id: check-hooks-apply
name: Check hooks apply to the repository
description: Useful when testing new hooks to see if they apply to the repository
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
name: Run codespell
description: Check spelling with codespell
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.6
hooks:
- id: chmod
name: Set file permissions
description: Does not run on Windows so setup as a manual hook
args: ['644']
files: \.md$
stages: [manual]
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
stages: [manual]
types: [python]
args: ['-rn', '--rcfile=.github/linters/.pylintrc']
- id: npm-ci
name: Install Node dependencies
entry: npm ci
language: system
pass_filenames: false
- id: eleventy-build-check
name: Eleventy build and output check
entry: npm run build
language: system
pass_filenames: false
- id: test-lerna
name: Run test-lerna
description: Run lerna tests
entry: npx lerna run test -- --run
language: system
pass_filenames: false
- id: prettier
name: Run prettier
description: format files with prettier
entry: prettier --write '**/*.css' '**/*.js' '**/*.json' '**/*.md' '**/*.yaml' '**/*.yml'
files: \.(css|js|json|md|ya?ml)$
language: node
additional_dependencies: ['prettier@3.8.1']
pass_filenames: false
- id: check-zip-file-is-not-committed
name: Check no zip files are committed
description: Zip files are not allowed in the repository
language: fail
entry: |
Zip files are not allowed in the repository as they are hard to
track and have security implications. Please remove the zip file from the repository.
files: (?i)\.zip$
- repo: https://github.com/biomejs/pre-commit
rev: v0.6.1
hooks:
- id: biome-check
name: run biome-check
description: Format, organize imports, lint, and apply safe fixes to the committed files
additional_dependencies: ['@biomejs/biome@2.4.4']
- repo: https://github.com/thlorenz/doctoc.git
rev: v2.3.0
hooks:
- id: doctoc
name: Add TOC for Markdown and RST files
description: Adds a Markdown table of contents
files: \.md$
exclude: |
(?x)
^frontend/.*\.md$|^\.github/pull_request_template\.md$
- repo: https://github.com/pycqa/isort
rev: 8.0.1
hooks:
- id: isort
name: isort (python)
description: isort is a Python utility / library to sort imports alphabetically and automatically separate into sections and by type
# GO-based
# - repo: https://github.com/gitleaks/gitleaks
# rev: v8.27.2
# hooks:
# - id: gitleaks
# name: Run gitleaks
# description: Check for secrets with gitleaks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: end-of-file-fixer
name: Run end-of-file-fixer
description: Makes sure files end in a newline and only a newline
- id: check-case-conflict
name: Run check-case-conflict
description: Check for files with names that would conflict on a case-insensitive filesystem like MacOS HFS+ or Windows FAT
- id: check-illegal-windows-names
name: Run check-illegal-windows-names
description: Check for files that cannot be created on Windows
- id: check-merge-conflict
name: Run check-merge-conflict
description: Check for files that contain merge conflict strings
- id: check-vcs-permalinks
name: Run check-vcs-permalinks
description: Ensures that links to vcs websites are permalinks
- id: detect-aws-credentials
name: Run detect-aws-credentials
description: Checks for the existence of AWS secrets that you have set up with the AWS CLI
args: [--allow-missing-credentials]
- id: detect-private-key
name: Run detect-private-key
description: Checks for the existence of private keys
- id: file-contents-sorter
name: Run file-contents-sorter
description: Sorts and removes duplicates from the codespell dictionary
args: [--unique]
files: ^\.github/linters/codespell\.txt$
- id: fix-byte-order-marker
name: Run fix-byte-order-marker
description: Removes UTF-8 byte order marker
- id: forbid-submodules
name: Run forbid-submodules
description: Prevent addition of new git submodules
- id: trailing-whitespace
name: Run trailing-whitespace
description: Trims trailing whitespace
args: [--markdown-linebreak-ext=md]
- id: check-yaml
name: Run check-yaml
description: Attempts to load all yaml files to verify syntax
- id: check-json
name: Run check-json
description: Attempts to load all json files to verify syntax
# - id: pretty-format-json
- id: check-added-large-files
name: Run check-added-large-files
description: Prevent giant files from being committed
args: ['--maxkb=1500']
- repo: https://github.com/rhysd/actionlint
rev: v1.7.11
hooks:
- id: actionlint
name: Run actionlint
description: Static checker for GitHub Actions workflow files
- repo: https://github.com/oxipng/oxipng
rev: v10.1.0
hooks:
- id: oxipng
name: Run oxipng
description: Multithreaded PNG optimizer written in Rust
args: ['--fix', '-o', '4', '--strip', 'safe', '--alpha']
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v10.0.2
hooks:
- id: eslint
name: Find and fix problems in your JavaScript code
description: ESLint statically analyzes your code to quickly find problems.
entry: eslint --config .github/linters/eslint.config.js --fix
language: node
files: \.(cjs|js|mjs)$
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.47.0
hooks:
- id: markdownlint
name: Run markdownlint
description: MarkdownLint Command Line Interface
types: [markdown]
args: ['--config', '.github/linters/.markdown-lint.yml']
files: \.md$
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: rst-backticks
name: detect common mistake of using single backticks when writing rst
types: [rst]
- id: rst-directive-colons
name: detect mistake of rst directive not ending with double colon or space before the double colon
types: [rst]
- id: rst-inline-touching-normal
name: detect mistake of inline code touching normal text in rst
types: [rst]
- repo: https://github.com/adrienverge/yamllint
rev: v1.38.0
hooks:
- id: yamllint
name: Run yamllint
description: check YAML files with yamllint
args: [--strict, -c=.github/linters/.yaml-lint.yml]
types: [yaml]
files: \.ya?ml$
- repo: https://github.com/editorconfig-checker/editorconfig-checker
rev: v3.6.1
hooks:
- id: editorconfig-checker
name: Run editorconfig-checker
description: Validate files against the .editorconfig configuration
# - repo: https://github.com/koalaman/shellcheck-precommit
# rev: v0.9.0
# hooks:
# - id: shellcheck
# name: run shellcheck
- repo: https://github.com/psf/black
rev: 26.1.0
hooks:
- id: black
name: The uncompromising Python code formatter
description: Black is the uncompromising Python code formatter.
types: [python]
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.15.4
hooks:
# Run the linter.
- id: ruff-check
args: ['--config', '.github/linters/.ruff.toml']
# Run the formatter.
- id: ruff-format
args: ['--config', '.github/linters/.ruff.toml']
- repo: https://github.com/PyCQA/bandit
rev: 1.9.4
hooks:
- id: bandit
name: A security linter from PyCQA
description: Bandit is a tool designed to find common security issues in Python code
args: ['-c', 'pyproject.toml', '-r', 'scripts']
types: [python]
pass_filenames: false
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.19.1
hooks:
- id: mypy
name: Run mypy
description: Optional static typing for Python
types: [python]
- repo: https://github.com/pycqa/flake8
rev: 7.3.0
hooks:
- id: flake8
name: Run flake8
description: flake8 is a python tool that checks the style and quality of some python code
types: [python]
args: ['--config', '.github/linters/.flake8']
- repo: https://github.com/zizmorcore/zizmor-pre-commit
rev: v1.22.0
hooks:
- id: zizmor
name: run zizmor
description: zizmor is a static analysis tool for GitHub Actions
# args: [--config=.github/linters/zizmor.yml]
files: ^\.github/workflows/.*$
types: [yaml]