-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
174 lines (161 loc) · 5.89 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
minimum_pre_commit_version: "1.15"
default_stages: [commit, push]
repos:
#: -----------------------------------------------------------------------------
#: Meta hooks
#: -----------------------------------------------------------------------------
#: Meta hooks provided by pre-commit
- repo: meta
hooks:
- id: identity
stages: [manual]
- id: check-hooks-apply
stages: [manual]
- id: check-useless-excludes
stages: [manual]
#: -----------------------------------------------------------------------------
#: Commit hooks
#: -----------------------------------------------------------------------------
#: code unspecific out-of-the-box hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 3298ddab3c13dd77d6ce1fc0baf97691430d84b0 # frozen: v4.3.0
hooks:
- id: no-commit-to-branch
args: [
--branch, staging,
# --branch, master,
--pattern, release/.*,
]
- id: check-case-conflict
- id: name-tests-test
args: ["--django"]
- id: check-json
- id: pretty-format-json
args: ["--indent=4", "--autofix"]
- id: check-toml
- id: check-yaml
- id: detect-private-key
- id: trailing-whitespace
stages: [commit, push]
- id: end-of-file-fixer
stages: [commit, push]
#: several python code regex hooks
- repo: https://github.com/pre-commit/pygrep-hooks
rev: 6f51a66bba59954917140ec2eeeaa4d5e630e6ce # frozen: v1.9.0
hooks:
- id: python-no-log-warn
- id: python-no-eval
#: pyupgrade - upgrade old python syntax to new
- repo: https://github.com/asottile/pyupgrade
rev: d232077d3bc16dcbaee30b42d35197f8bf337a36 # frozen: v2.37.1
hooks:
- id: pyupgrade
args: [--py36-plus]
#: isort - sort imports
#: Inline skip: `# isort: skip`
- repo: https://github.com/timothycrosley/isort
rev: c5e8fa75dda5f764d20f66a215d71c21cfa198e1 # frozen: 5.10.1
hooks:
- id: isort
#: blacken-docs - black for python code in docs
- repo: https://github.com/asottile/blacken-docs
rev: 7ae9389351f4090e3993de28015a05a18ca6b8a7 # frozen: v1.12.1
hooks:
- id: blacken-docs
#: black - python formatter
#: Inline skip: mark block with `# fmt: off` and `# fmt: on` (same indent)
- repo: https://github.com/psf/black
rev: f6c139c5215ce04fd3e73a900f1372942d58eca0 # frozen: 22.6.0
hooks:
- id: black
args: [--safe]
#: bandit - python code security analyzer
#: Inline skip: `# nosec`
- repo: https://github.com/PyCQA/bandit
rev: 1ed79063e3672a1c6d91ee27cb648e07a7465344 # frozen: 1.7.4
hooks:
- id: bandit
require_serial: true
exclude: tests/.*$
#: flake8 - python linter
#: File skip: `# flake8: noqa`
#: Inline skip: `# noqa` or `# noqa: CODE,...`
- repo: https://gitlab.com/pycqa/flake8
rev: dcd740bc0ebaf2b3d43e59a0060d157c97de13f3 # frozen: 3.9.2
hooks:
- id: flake8
args: [--min-python-version=3.6.1]
additional_dependencies:
#: Colored output - needs custom format
- "flake8-colors"
#: Finding likely bugs and design problems
#: B001-B014 | B301-B306 | B901-B903,B950
- "flake8-bugbear==20.1.4"
#: Write better list/set/dict comprehensions
#: C400-C416
- "flake8-comprehensions==3.2.2"
#: Check docstrings with PEP257
#: D100-D107 | D200-D215 | D300-D302 | D400-D417
- "flake8-docstrings==1.5.0"
- "pydocstyle==5.0.2"
#: Find dead/out-commented code
#: E800
- "flake8-eradicate==0.3.0"
#: Validate (lack of) logging format strings
#: G001-G004, G010 | G100 | G200-G202
- "flake8-logging-format==0.6.0"
#: Find line breaks with '\'
#: N400
- "flake8-broken-line==0.2.0"
#: Check your code against PEP 8 naming conventions
#: N801-N807, N811-N817
- "pep8-naming==0.10.0"
#: Find mutable default assignments in func/class definitions
#: M511
- "flake8-mutable==1.2.0"
#: Check common style issues or inconsistencies with pytest-based tests
#: PT001-PT019
- "flake8-pytest-style==1.1.1"
#: Check if typing imports are properly guarded
#: TYP001 - TYP006
- "flake8-typing-imports==1.9.0"
#: Find strings with leading 'u'
#: UPS
- "flake8-no-u-prefixed-strings==0.2"
#: Make more readable variables names
#: VNE001-VNE003
- "flake8-variables-names==0.0.3"
#: Checks for misuse of sys.version or sys.version_info (Py 3.10 / 4.0 coming)
#: YTT101-YTT103 | YTT201-YTT204 | YTT301-YTT303
- "flake8-2020==1.6.0"
#: poetry - dependency and packaging management
- repo: https://github.com/Cielquan/poetry
rev: 901008fd458066b613b42baf617cfa28ef602cbc
hooks:
#: Check config file
- id: poetry-check
#: Update lock file
- id: poetry-lock
#: Hooks managed via tox `pre-commit` venv
- repo: local
hooks:
#: pylint - python linter
#: File skip: `# pylint: skip-file`
#: Inline change: `# pylint: disable|enable=CODE|NAME`
- id: pylint
name: pylint
description: run pylint over the installed version if available
entry: python3 .tox_env_exe_runner.py pylint pre-commit,dev
language: system
types: [python]
#: mypy - python type checker
#: Skip file: `# type: ignore` at top
#: Inline skip: `# type: ignore` or `# type: ignore[CODE, ...]`
- id: mypy
args: ["--config-file=tox.ini"]
name: mypy
description: run mypy over the installed version if available
entry: python3 .tox_env_exe_runner.py mypy pre-commit,dev
language: system
types: [python]
require_serial: true