-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
111 lines (109 loc) · 3.29 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
102
103
104
105
106
107
108
109
110
111
default_stages: [commit, manual]
repos:
- repo: 'https://github.com/asottile/setup-cfg-fmt'
rev: v1.17.0
hooks:
- id: setup-cfg-fmt
- repo: 'https://github.com/pre-commit/pre-commit-hooks'
rev: v4.0.0
hooks:
- id: check-json
- id: check-yaml
- id: name-tests-test
args:
- '--django'
exclude: "(factories/|_factory.py$)"
- id: requirements-txt-fixer
- id: check-symlinks
- id: check-docstring-first
- id: detect-aws-credentials
args:
- '--allow-missing-credentials'
- id: detect-private-key
- id: forbid-new-submodules
- id: check-added-large-files
- id: check-builtin-literals
args:
- '--ignore=dict,list'
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-case-conflict
- id: check-merge-conflict
- id: debug-statements
- repo: https://github.com/hadialqattan/pycln
rev: v0.0.2
hooks:
- id: pycln
args: [--all]
exclude: "(settings/|const(.*)/|__init__.py$|const(.*).py$|apps.py)"
- repo: 'https://github.com/pycqa/isort'
rev: 5.8.0
hooks:
- id: isort
name: isort (python)
args:
- '--profile=black'
- '-l=120'
- 'known_django=django'
- 'sections=FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER'
# IMPORTANT: Excluded these folders/files to prevent cross/missing import.
exclude: "(settings/|const(.*)/|__init__.py$|const(.*).py$|apps.py)"
- repo: 'https://github.com/psf/black'
rev: 22.3.0
hooks:
- id: black
- repo: 'https://github.com/asottile/blacken-docs'
rev: v1.10.0
hooks:
- id: blacken-docs
additional_dependencies:
- black==v21.5b1
entry: blacken-docs --skip-errors
- repo: 'https://github.com/PyCQA/flake8'
rev: 3.9.2
hooks:
- id: flake8
args:
- >-
--ignore=
B001,B006,
C901,
E121,E126,E127,E128,E131,E203,E226,E251,E261,E262,E265,E401,E402,E501,E502,E722,
F401,F401,F403,F403,F405,F405,F541,F541,
N801,N802,N803,N806,N812,N814,N814,
SIM102,SIM105,SIM106,SIM110,SIM118,SIM210,SIM300,
T001,
W292,W292,W391,W503,W503,W504,W504,
- '--max-line-length=250'
- '--max-complexity=30'
additional_dependencies:
- pep8-naming
- flake8-typing-imports==1.10.1
- flake8-bugbear
- flake8-mutable
- flake8-print
- flake8-simplify
- repo: 'https://github.com/asottile/pyupgrade'
rev: v2.16.0
hooks:
- id: pyupgrade
args:
- '--py36-plus'
- repo: 'https://github.com/PyCQA/bandit'
rev: 1.7.0
hooks:
- id: bandit
args:
- '-lll'
- '-iii'
- '--skip=B105,B110,B311,B608'
- '--quiet'
exclude: "(migrations/|docs/|templates/|geo/|sent_emails/)"
- repo: 'https://github.com/alessandrojcm/commitlint-pre-commit-hook'
rev: v5.0.0
hooks:
# https://www.conventionalcommits.org/en/v1.0.0/#summary
# https://github.com/conventional-changelog/commitlint/#what-is-commitlint
- id: commitlint
stages:
- commit-msg