-
Notifications
You must be signed in to change notification settings - Fork 25
/
.pre-commit-config.yaml
149 lines (133 loc) · 4.02 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
# This file configures https://pre-commit.com/
# Based on pre-commit hooks in
# https://github.com/pre-commit/pre-commit-hooks
# https://github.com/jumanjihouse/pre-commit-hooks
# to use specific hooks and options.
fail_fast: false
repos:
#
# Common
#
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.4.0"
hooks:
- id: check-case-conflict
- id: trailing-whitespace
exclude: \.output
- id: end-of-file-fixer
exclude: \.(cp?p?$|output)
- id: check-added-large-files
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: check-yaml
- id: check-toml
#
# Git.
#
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.4.0"
hooks:
- id: check-merge-conflict
# - id: no-commit-to-branch
#
# Python
#
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.4.0"
hooks:
- id: debug-statements
- id: check-docstring-first
- id: requirements-txt-fixer
- repo: https://github.com/PyCQA/autoflake
rev: v2.0.0
hooks:
- id: autoflake
exclude: &fixtures tests(/\w*)*/functional/|tests/input|doc/data/messages|tests(/\w*)*data/
args:
- --in-place
- --remove-all-unused-imports
- --expand-star-imports
- --remove-duplicate-keys
- --remove-unused-variables
- repo: https://github.com/pycqa/pylint
rev: "v2.15.9" # pylint-2.14.5
hooks:
- id: pylint
args: ["-rn", "-sn", "--rcfile=.pylintrc", "--fail-on=I", "--load-plugins=pylint.extensions.docparams"]
exclude: tests(/\w*)*/functional/|tests/input|tests(/\w*)*data/|doc/
- id: pylint
alias: pylint-with-spelling
args: ["-rn", "-sn", "--rcfile=.pylintrc", "--fail-on=I", "--spelling-dict=en,ru"]
exclude: tests(/\w*)*/functional/|tests/input|tests(/\w*)*data/|doc/
stages: [manual]
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
args: ["--config", ".flake8"]
additional_dependencies:
[flake8-bugbear==22.12.6, flake8-typing-imports==1.14.0]
exclude: ".*fixtures"
- repo: https://github.com/pre-commit/pre-commit
rev: v2.20.0
hooks:
- id: validate_manifest
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.991
hooks:
- id: mypy
args: ["--config-file", ".mypy.ini", "--install-types"]
additional_dependencies:
[
"isort>=5",
"platformdirs==2.2.0",
"py==1.11",
"tokenize-rt==3.2.0",
"tomlkit>=0.10.1",
"types-pkg_resources==0.1.3",
"types-all",
"types-attrs",
"types-requests",
"types-dataclasses>=0.1.3",
"types-PyYAML",
"types-typed-ast>=1.4.1",
"types-markdown>=3.6.0.20240316"
]
# exclude: tests(/\w*)*/functional/|tests/input|tests(/.*)+/conftest.py|doc/data/messages|tests(/\w*)*data/
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
- repo: https://github.com/ambv/black
rev: "22.12.0"
hooks:
- id: black
args: ["-l", "120", "--skip-string-normalization" ]
# - repo: https://github.com/DanielNoord/pydocstringformatter
# rev: v0.7.2
# hooks:
# - id: pydocstringformatter
# exclude: *fixtures
# args: ["--max-summary-lines=2", "--linewrap-full-docstring"]
- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
hooks:
- id: bandit
args: ["-r", "-lll"]
exclude: ".*fixtures"
# - repo: https://github.com/pycqa/isort
# rev: 5.12.0
# hooks:
# - id: isort
#
# Markdown
#
# Written on Ruby, but we don't want to install gem.
# - repo: https://github.com/markdownlint/markdownlint
# rev: "v0.12.0"
# hooks:
# - id: markdownlint
# - repo: https://github.com/executablebooks/mdformat
# rev: "0.7.16"
# hooks:
# - id: mdformat