-
-
Notifications
You must be signed in to change notification settings - Fork 562
/
Copy path.pre-commit-config.yaml
154 lines (142 loc) · 3.93 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
ci:
autoupdate_schedule: quarterly
skip:
- shfmt
- shellcheck
- hadolint
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
# Git style
- id: check-added-large-files
- id: check-merge-conflict
- id: check-vcs-permalinks
- id: forbid-new-submodules
- id: no-commit-to-branch
# Common errors
- id: end-of-file-fixer
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
exclude: CHANGELOG.md
- id: check-yaml
- id: check-merge-conflict
- id: check-executables-have-shebangs
# Cross platform
- id: check-case-conflict
- id: mixed-line-ending
args: [--fix=lf]
# Non-modifying checks:
- id: name-tests-test
files: >-
^tests/[^_].*\.py$
# Security
- id: detect-aws-credentials
args:
- --allow-missing-credentials
- id: detect-private-key
# Detect hardcoded secrets
- repo: https://github.com/gitleaks/gitleaks
rev: v8.24.0
hooks:
- id: gitleaks
# Dockerfile
- repo: https://github.com/hadolint/hadolint
rev: v2.12.1-beta
hooks:
- id: hadolint
# YAML
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.2.3
hooks:
- id: yamlfmt
args:
- --mapping=2
- --sequence=2
- --offset=0
- --width=75
- --implicit_start
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.36.2
hooks:
- id: yamllint
types:
- file
- yaml
args:
- --strict
# JSON5
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
# https://prettier.io/docs/en/options.html#parser
files: .json5$
# Bash
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: shfmt
args:
- -l
- -i
- '2'
- -ci
- -sr
- -w
- id: shellcheck
# Python
- repo: https://github.com/pre-commit/mirrors-mypy.git
rev: v1.15.0
hooks:
- id: mypy
alias: mypy-py313
name: MyPy, for Python 3.13
additional_dependencies:
- lxml # dep of `--txt-report`, `--cobertura-xml-report` & `--html-report`
- pytest
- pytest-mock
args:
- --python-version=3.13
- --any-exprs-report=.tox/.tmp/.test-results/mypy--py-3.13
- --cobertura-xml-report=.tox/.tmp/.test-results/mypy--py-3.13
- --html-report=.tox/.tmp/.test-results/mypy--py-3.13
- --linecount-report=.tox/.tmp/.test-results/mypy--py-3.13
- --linecoverage-report=.tox/.tmp/.test-results/mypy--py-3.13
- --lineprecision-report=.tox/.tmp/.test-results/mypy--py-3.13
- --txt-report=.tox/.tmp/.test-results/mypy--py-3.13
pass_filenames: false
- id: mypy
alias: mypy-py311
name: MyPy, for Python 3.11
additional_dependencies:
- lxml # dep of `--txt-report`, `--cobertura-xml-report` & `--html-report`
- pytest
- pytest-mock
args:
- --python-version=3.11
- --any-exprs-report=.tox/.tmp/.test-results/mypy--py-3.11
- --cobertura-xml-report=.tox/.tmp/.test-results/mypy--py-3.11
- --html-report=.tox/.tmp/.test-results/mypy--py-3.11
- --linecount-report=.tox/.tmp/.test-results/mypy--py-3.11
- --linecoverage-report=.tox/.tmp/.test-results/mypy--py-3.11
- --lineprecision-report=.tox/.tmp/.test-results/mypy--py-3.11
- --txt-report=.tox/.tmp/.test-results/mypy--py-3.11
pass_filenames: false
- id: mypy
alias: mypy-py39
name: MyPy, for Python 3.9
additional_dependencies:
- lxml # dep of `--txt-report`, `--cobertura-xml-report` & `--html-report`
- pytest
- pytest-mock
args:
- --python-version=3.9
- --any-exprs-report=.tox/.tmp/.test-results/mypy--py-3.9
- --cobertura-xml-report=.tox/.tmp/.test-results/mypy--py-3.9
- --html-report=.tox/.tmp/.test-results/mypy--py-3.9
- --linecount-report=.tox/.tmp/.test-results/mypy--py-3.9
- --linecoverage-report=.tox/.tmp/.test-results/mypy--py-3.9
- --lineprecision-report=.tox/.tmp/.test-results/mypy--py-3.9
- --txt-report=.tox/.tmp/.test-results/mypy--py-3.9
pass_filenames: false