-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
70 lines (70 loc) · 3.15 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
default_language_version:
python: python3.10
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-added-large-files
args: ['--maxkb=3000']
- id: check-merge-conflict
- id: check-ast # checks python syntax tree for errors
- id: debug-statements
- id: check-yaml # checks .yaml for errors
args: ['--unsafe'] # Instead of loading the files, simply parse them for syntax.
exclude: 'staged_variables.yaml'
- id: check-toml # checks .toml for errors
- id: check-xml # checks .xml for errors
- id: detect-aws-credentials # detects aws cred
- id: detect-private-key # detects private keys
- id: requirements-txt-fixer # fixes requirements txt and sorts it
# - id: name-tests-test
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort # sorts improts
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.9.1
hooks:
- id: black # autoformat python code
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.9.1
hooks:
- id: black-jupyter # autoformat python code
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies: [
'Flake8-pyproject==1.2.2', # flake8 settings in pyproject
'flake8-annotations-complexity==0.0.7', # checks for annotation complexity
'flake8-annotations==3.0.1',
'flake8-cognitive-complexity==0.1.0', # check for functions complexity
'flake8-expression-complexity==0.0.11', # check for expression complexity
'flake8-bugbear==23.1.20', # find posible bugs, i.e. default mutable args
'flake8-print==5.0.0', # forbit prints
'flake8-secure-coding-standard==1.3.0', # check for posible security vulnerability
'flake8-simplify==0.19.3', # make code simplier
'flake8-warnings==0.4.0', # warns you about using deprecated modules, classes, and functions.
'flake8-bandit==4.1.1', # Automated security testing built right into your workflow!
'flake8-force-keyword-arguments==1.0.4', # force at most 3 positional args
'flake8-builtins==2.1.0', # check if builtins used as varss
'flake8-comprehensions==3.10.1', # better list/dict/gen comprehensions
'flake8-noqa==1.3.0', # better noqa annotations, forces strict noqa annotations
# 'flake8-fastapi==0.7.0', # FastAPI fixes
'flake8-pie==0.16.0', # better code style
'flake8-return==1.2.0', # better returns and raises
]
- repo: https://github.com/pycqa/autoflake
rev: v2.2.1
hooks:
- id: autoflake # automaticly fixes some flake8 problems
args:
[
"--in-place",
"--expand-star-imports",
"--remove-all-unused-imports",
"--remove-unused-variables",
"--ignore-init-module-imports",
]