-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
133 lines (132 loc) · 3.69 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
---
# 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/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]
### 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)^(
# need to include typos configs in templates/ as well
^.*(\.typos\.toml).*$ |
^.*(\.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]