-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
101 lines (88 loc) · 2.68 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
# # See https://pre-commit.com for more information
# # See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/myint/autoflake
rev: v1.7.7
hooks:
- id: autoflake
args:
#- --in-place
- --remove-all-unused-imports
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
args:
- --line-length=170
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
args: ['--maxkb=5000']
- id: check-ast
# - id: check-docstring-first
- id: detect-private-key
- id: detect-aws-credentials
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
args:
- --max-line-length=170
- --max-doc-length=170
- --ignore=E203,W503,E712,E731, F841, F821, E402
# E712 comparision funktioniert nicht gut mit inplace operationen von pandas deshalb deaktiviert.
# E731 Lambda Avoidance can be avoided
# F841, F821 Does not work correctly. E402 does not work correctly because the imports can be seperated via comments.
# for security problems
- repo: https://github.com/pycqa/bandit
rev: 1.7.4
hooks:
- id: bandit
# Bandit does not need to run on test code
exclude: tests/
- repo: https://github.com/PyCQA/pydocstyle
rev: 6.1.1
hooks:
- id: pydocstyle
additional_dependencies: ["toml"]
- repo: https://github.com/btford/write-good
rev: v1.0.8
hooks:
- id: write-good
files: "\\.(rst|md|markdown|mdown|mkdn)$"
args:
- --no-passive
# exclude: docs/infra/gerrit.rst|docs/best-practices.rst
- repo: https://github.com/adamchainz/blacken-docs
rev: 1.13.0 # replace with latest tag on GitHub
hooks:
- id: blacken-docs
additional_dependencies:
- black==22.12.0
- repo: https://github.com/asottile/seed-isort-config
rev: v2.2.0
hooks:
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.4.2
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]
# shows old code and how to update it
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.2
hooks:
- id: pyupgrade
args: [--py36-plus]
# for poetry projects
- repo: https://github.com/python-poetry/poetry
rev: 1.3.2 # add version here
hooks:
- id: poetry-check
- id: poetry-lock
- id: poetry-export
args: ["-f", "requirements.txt", "-o", "requirements.txt"]