-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
154 lines (153 loc) · 4.21 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
---
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: |
(?x)^(
^.*(package-lock\.json)$
^.*(uv\.lock)$
)$
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)$
)$
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v5.0.0"
hooks:
- id: check-added-large-files
args: [--maxkb=500000]
stages: [pre-commit]
- id: check-case-conflict
stages: [pre-commit]
- id: check-merge-conflict
stages: [pre-commit]
- id: check-ast
stages: [pre-commit]
- id: check-json
stages: [pre-commit]
- id: check-toml
stages: [pre-commit]
- id: check-yaml
stages: [pre-commit]
- id: end-of-file-fixer
stages: [pre-commit]
- id: mixed-line-ending
stages: [pre-commit]
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
stages: [pre-commit]
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: "v1.5.5"
hooks:
- id: remove-crlf
stages: [pre-commit]
# - id: remove-tabs
# stages: [pre-commit]
- repo: https://github.com/sirosen/texthooks
rev: "0.6.8"
hooks:
- id: fix-smartquotes
stages: [pre-commit]
- id: fix-ligatures
stages: [pre-commit]
- repo: https://github.com/zricethezav/gitleaks
rev: "v8.23.1"
hooks:
- id: gitleaks
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: "v0.43.0"
hooks:
- id: markdownlint
name: Lint markdown files
args:
- --config=.markdownlint.yaml
- --fix
stages: [pre-commit]
# ### NOTE: Prettier broke plugins:
# https://github.com/pre-commit/mirrors-prettier/blob/main/README.md
# - 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: [pre-commit]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "v2.5.0"
hooks:
- id: pyproject-fmt
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.9.2"
hooks:
- id: ruff
name: Lint with Ruff
args:
- --fix
- --config=.ruff.toml
stages: [pre-commit]
- id: ruff-format
name: Format with Ruff
args:
- --config=.ruff.toml
stages: [pre-commit]
- repo: https://github.com/kynan/nbstripout
rev: "0.8.1"
hooks:
- id: nbstripout
stages: [pre-commit]
- repo: https://github.com/koalaman/shellcheck-precommit # local
rev: "v0.10.0"
hooks:
- id: shellcheck
name: Lint shell scripts
language: system
entry: shellcheck
types: ["shell"]
exclude: "^.*zsh$" # ignore '*.zsh" scripts'
stages: [pre-commit]
- repo: https://github.com/scop/pre-commit-shfmt
rev: "v3.10.0-2"
hooks:
- id: shfmt
name: Format shell scripts
args:
- -i
- "2"
- -ci
- -bn
stages: [pre-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.29.4"
hooks:
- id: typos
name: Spellcheck with Typos
args: ["--config", ".typos.toml"]
exclude: |
(?x)^(
^.*(\.typos\.toml)$ |
^.*(\.git.*)$
)$
stages: [pre-commit]
- repo: https://github.com/adrienverge/yamllint.git
rev: "v1.35.1"
hooks:
- id: yamllint
name: Lint yaml files
args: [-c=.yamllint.yaml]
stages: [pre-commit]