-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
66 lines (59 loc) · 2.43 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
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace # Trailing whitespace checker
- id: end-of-file-fixer # End-of-file newline checker
- id: check-yaml # YAML syntax checker
- id: check-added-large-files # Prevents you from committing large files
- id: check-ast # Python AST checker
- id: check-json # JSON syntax checker
- id: check-xml # XML syntax checker
- repo: https://github.com/psf/black
rev: 23.12.1
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies:
# source: https://github.com/DmytroLitvinov/awesome-flake8-extensions
# all-in-one plugins
- flake8-bugbear # tries to find bugs in your code
- flake8-simplify # encourages simplification of complex expressions
# clean code
- flake8-comprehensions # helps you write better list/set/dict comprehensions
- flake8-picky-parentheses # checks for redundant parentheses and alignment of parentheses and brackets
- flake8-return # plugin that checks return values
- flake8-annotations # enforces type annotations
# naming
- flake8-builtins # checks for python builtins being used as variables or parameters
- flake8-variables-names # checks for good variable names
- pep8-naming # enforces PEP 8 naming conventions
# complexity
- flake8-cognitive-complexity # plugin that checks for high cognitive complexity
- flake8-annotations-complexity # enforces complexity limits for function annotations
# docstrings
- flake8-spellcheck # checks spelling
- flake8-docstrings # docstring conventions
# Comments
- flake8-eradicate # enforces the removal of commented out code
# Annotations
- flake8-black # enforces black formatting
args:
[
"--max-line-length",
"104",
"--extend-ignore",
"D100, SC200, SC100, VNE001, N803, ANN101, ANN003, N806, E203",
"--exclude",
"__init__.py, test_*.py, deepsurv_hp.py",
"--max-cognitive-complexity",
"70",
]