-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
100 lines (100 loc) · 3.1 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
exclude: '^documents/'
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.37.3
hooks:
- id: pyupgrade
args: [--py37-plus, --keep-runtime-typing]
stages: [commit]
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
args: [ "--profile", "black" ]
stages: [commit]
- repo: https://github.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear==22.7.1
- flake8-django==1.1.2
- flake8-pytest-style==1.6.0
- flake8-typing-imports==1.12.0
args: [ --max-line-length=128, --extend-ignore=DJ01]
stages: [commit]
exclude: '^backend/\w+/migrations'
- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
hooks:
- id: bandit
args: [-r, -n, '10', -x, '*/*/tests/*', -s, 'B310']
stages: [commit]
exclude: '^backend/\w+/migrations'
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
hooks:
- id: mypy
stages: [commit]
files: '^backend/'
exclude: '^backend/\w+/migrations'
additional_dependencies:
- types-pytz==2022.1.2
- types-bleach==5.0.3
- types-python-dateutil==2.8.19
- types-requests==2.28.7
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-added-large-files
stages: [commit]
exclude: '^backend/(\w+/migrations)'
- id: check-ast
stages: [commit]
- id: fix-byte-order-marker
stages: [commit]
- id: check-json
stages: [commit]
- id: check-merge-conflict
stages: [commit]
- id: check-yaml
stages: [commit]
- id: end-of-file-fixer
stages: [commit]
exclude: '^(frontend/(build/|dist/))'
- id: debug-statements
stages: [commit]
- id: no-commit-to-branch
args: [--branch, master, --branch, develop]
stages: [commit]
- id: trailing-whitespace
stages: [commit]
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.10.0
hooks:
- id: eslint
args: [--ext, '.js', --ext, '.cjs', --ext, '.jsx', --rule, 'import/no-unresolved: 0', '--fix']
additional_dependencies:
- eslint-config-prettier@^3.3.0
- eslint-plugin-prettier@^3.1.0
- prettier@^3.0.2
entry: bash -c "cd src/frontend && npx eslint --fix 'src/**/*.js'"
stages: [commit]
exclude: '^(frontend/(build/|dist/|public/)|backend/.+/static/.*/vendor/)'
types: [file]
files: \.(js|jsx)$
- repo: https://github.com/jorisroovers/gitlint
rev: v0.17.0
hooks:
- id: gitlint
stages: [commit-msg]