-
Notifications
You must be signed in to change notification settings - Fork 4
/
.pre-commit-config.yaml
69 lines (69 loc) · 2.55 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
ci:
autofix_commit_msg: ':robot: pre-commit auto fixes [...]'
autoupdate_commit_msg: ':robot: pre-commit autoupdate'
repos:
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.16
hooks:
- id: mdformat
# Optionally add plugins
additional_dependencies:
- mdformat-gfm
- mdformat-black
- mdformat-shfmt
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
args: ['--maxkb=50000']
- id: check-ast
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-xml
- id: check-yaml
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
- id: name-tests-test
args: ['--django']
- id: pretty-format-json
- id: requirements-txt-fixer
- id: trailing-whitespace
exclude: 'setup.cfg'
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.3.0 # Replace with any tag/version: https://github.com/psf/black/tags
hooks:
- id: black
language_version: python3
additional_dependencies: ['click==8.0.4'] # Currently >8.0.4 breaks black
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies: [
bandit, # Dependency for flake8-bandit
flake8-bandit, # Security checks (currently breaks with bandit > 1.7.2)
flake8-bugbear, # Detect potential bugs
flake8-builtins, # Check for built-ins being used as variables
flake8-cognitive-complexity, # Check max function complexity
flake8-comprehensions, # Suggestions for better list/set/dict comprehensions
flake8-expression-complexity, # Check max expression complexity
flake8-fixme, # Check for FIXME, TODO, and XXX left in comments
flake8-isort, # Check import ordering
flake8-logging-format, # Validate (lack of) logging format strings
flake8-mutable, # Check for mutable default arguments
flake8-pie, # Misc. linting rules
flake8-pytest-style, # Check against pytest style guide
flake8-return, # Check return statements
flake8-simplify, # Suggestions to simplify code
flake8-sql, # Check SQL statement style
flake8-use-fstring, # Encourages use of f-strings vs old style
pep8-naming, # Check PEP8 class naming
]