-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy path.pre-commit-config.yaml
160 lines (160 loc) · 4.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
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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_stages: [pre-commit]
# Enable this to enforce a common Python version:
default_language_version:
python: python3.11
ci:
skip: [
'pip-audit',
'creosote',
'no-commit-to-branch',
# 'hadolint-docker',
'docker-compose-check',
'mypy-local', # Runs as a local hook now
]
repos:
- repo: https://github.com/pre-commit-ci/pre-commit-ci-config
rev: v1.6.1
hooks:
- id: check-pre-commit-ci-config
- repo: https://github.com/mxr/sync-pre-commit-deps
rev: v0.0.2
hooks:
- id: sync-pre-commit-deps
- repo: https://github.com/peterdemin/pip-compile-multi
rev: v2.7.1
hooks:
- id: pip-compile-multi-verify
files: ^requirements/.*\.(in|txt)$
- repo: https://github.com/pypa/pip-audit
rev: v2.7.3
hooks:
- id: pip-audit
args: [
'--disable-pip',
'--no-deps',
'--skip-editable',
'-r',
'requirements/base.txt',
'-r',
'requirements/test.txt',
'-r',
'requirements/dev.txt',
'--ignore-vuln',
'PYSEC-2021-13', # https://github.com/pallets-eco/flask-caching/pull/209
'--ignore-vuln',
'PYSEC-2022-42969', # https://github.com/pytest-dev/pytest/issues/10392
'--ignore-vuln',
'PYSEC-2023-73', # https://github.com/RedisLabs/redisraft/issues/608
]
files: ^requirements/.*\.txt$
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
hooks:
- id: pyupgrade
args: ['--keep-runtime-typing', '--py311-plus']
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.2
hooks:
- id: ruff
args: ['--fix', '--exit-non-zero-on-fix']
- id: ruff-format
- repo: https://github.com/PyCQA/pylint
rev: v3.3.3
hooks:
- id: pylint
args: [
'--disable=import-error',
'-rn', # Disable full report
'-sn', # Disable evaluation score
'--ignore-paths=migrations',
]
additional_dependencies:
- tomli
- repo: https://github.com/fredrikaverpil/creosote
rev: v4.0.0
hooks:
- id: creosote
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
args:
- --external-sources
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-toml
- id: check-vcs-permalinks
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: destroyed-symlinks
- id: detect-aws-credentials
args: ['--allow-missing-credentials']
- id: detect-private-key
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: fix-encoding-pragma
args: ['--remove']
- id: forbid-new-submodules
- id: mixed-line-ending
- id: name-tests-test
args: ['--pytest']
- id: no-commit-to-branch
- id: requirements-txt-fixer
files: requirements/.*\.in
- id: trailing-whitespace
args: ['--markdown-linebreak-ext=md']
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: forbid-crlf
- id: remove-crlf
- id: forbid-tabs
- id: remove-tabs
- repo: https://github.com/pycontribs/mirrors-prettier
rev: v3.4.2
hooks:
- id: prettier
- repo: https://github.com/ducminh-phan/reformat-gherkin
rev: v3.0.1
hooks:
- id: reformat-gherkin
files: \.feature$
# - repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs
# rev: v1.1.2
# hooks:
# - id: dockerfile_lint
# files: .*Dockerfile.*
# - repo: https://github.com/hadolint/hadolint
# rev: v2.12.1-beta
# hooks:
# - id: hadolint-docker
- repo: https://github.com/IamTheFij/docker-pre-commit
rev: v3.0.1
hooks:
- id: docker-compose-check
- repo: local
hooks:
- id: mypy-local
name: mypy
entry: .venv/bin/mypy
args:
- --no-warn-unused-ignores
- --no-warn-redundant-casts
- . # Required to honour settings in pyproject.toml
language: system
types_or: [python, pyi]
require_serial: true
pass_filenames: false # Mypy is unreliable if module import order varies