Skip to content

Commit 36be6f6

Browse files
committed
Added checks.
Signed-off-by: Pavel Kirilin <[email protected]>
1 parent 0c7676a commit 36be6f6

File tree

5 files changed

+946
-45
lines changed

5 files changed

+946
-45
lines changed

.flake8

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
[flake8]
2+
max-complexity = 6
3+
inline-quotes = double
4+
max-line-length = 88
5+
extend-ignore = E203
6+
docstring_style=sphinx
7+
8+
ignore =
9+
; Found too deep nesting
10+
WPS220,
11+
; Found `%` string formatting
12+
WPS323,
13+
; Found `f` string
14+
WPS305,
15+
; Missing docstring in public module
16+
D100,
17+
; Missing docstring in magic method
18+
D105,
19+
; Missing docstring in __init__
20+
D107,
21+
; Found class without a base class
22+
WPS306,
23+
; Missing docstring in public nested class
24+
D106,
25+
; First line should be in imperative mood
26+
D401,
27+
; Found `__init__.py` module with logic
28+
WPS412,
29+
; Found implicit string concatenation
30+
WPS326,
31+
; Found string constant over-use
32+
WPS226,
33+
; Found upper-case constant in a class
34+
WPS115,
35+
; Found nested function
36+
WPS430,
37+
; Found using `@staticmethod`
38+
WPS602,
39+
; Found method without arguments
40+
WPS605,
41+
; Found overused expression
42+
WPS204,
43+
; Found too many module members
44+
WPS202,
45+
; Found too high module cognitive complexity
46+
WPS232,
47+
; line break before binary operator
48+
W503,
49+
; Found module with too many imports
50+
WPS201,
51+
; Found vague import that may cause confusion: X
52+
WPS347,
53+
; Inline strong start-string without end-string.
54+
RST210,
55+
; subprocess call with shell=True seems safe, but may be changed in the future.
56+
S602,
57+
; Starting a process with a partial executable path.
58+
S607,
59+
; Consider possible security implications associated with subprocess module.
60+
S404,
61+
; Found nested class
62+
WPS431,
63+
; Found wrong module name
64+
WPS100,
65+
; Found too many methods
66+
WPS214,
67+
; Found too long ``try`` body
68+
WPS229,
69+
; Found function with too much cognitive complexity
70+
WPS231,
71+
72+
; all init files
73+
__init__.py:
74+
; ignore not used imports
75+
F401,
76+
; ignore import with wildcard
77+
F403,
78+
; Found wrong metadata variable
79+
WPS410,
80+
81+
per-file-ignores =
82+
; all tests
83+
test_*.py,tests.py,tests_*.py,*/tests/*:
84+
; Use of assert detected
85+
S101,
86+
87+
exclude =
88+
./.git,
89+
./venv,
90+
./cached_venv,
91+
./var,

.pre-commit-config.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v2.4.0
6+
hooks:
7+
- id: check-ast
8+
- id: trailing-whitespace
9+
- id: check-toml
10+
- id: end-of-file-fixer
11+
12+
- repo: https://github.com/asottile/add-trailing-comma
13+
rev: v2.1.0
14+
hooks:
15+
- id: add-trailing-comma
16+
17+
- repo: local
18+
hooks:
19+
- id: black
20+
name: Format with Black
21+
entry: black
22+
language: system
23+
types: [python]
24+
25+
- id: autoflake
26+
name: autoflake
27+
entry: autoflake
28+
language: system
29+
types: [ python ]
30+
args: [ --in-place, --remove-all-unused-imports, --remove-duplicate-keys ]
31+
32+
- id: isort
33+
name: isort
34+
entry: isort
35+
language: system
36+
types: [ python ]
37+
38+
- id: flake8
39+
name: Check with Flake8
40+
entry: flake8
41+
language: system
42+
pass_filenames: false
43+
types: [ python ]
44+
args: [--count, .]
45+
46+
- id: mypy
47+
name: Validate types with MyPy
48+
entry: mypy
49+
language: system
50+
types: [ python ]
51+
52+
- id: yesqa
53+
name: Remove usless noqa
54+
entry: yesqa
55+
language: system
56+
types: [ python ]

0 commit comments

Comments
 (0)