-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
137 lines (122 loc) · 3.5 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
exclude: '^docs/|/migrations/'
default_stages: [commit]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-docstring-first
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: check-json
- id: check-xml
- id: debug-statements
- id: check-builtin-literals
- id: check-case-conflict
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
- id: detect-private-key
- id: mixed-line-ending
- id: name-tests-test
args: [--pytest-test-first]
- id: sort-simple-yaml
- id: check-shebang-scripts-are-executable
- id: check-case-conflict
- id: check-ast
- id: check-symlinks
- repo: https://github.com/pre-commit/pygrep-hooks
rev: 'v1.10.0'
hooks:
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal
- repo: https://github.com/pre-commit/mirrors-prettier
rev: 'v4.0.0-alpha.8'
hooks:
- id: prettier
types_or: [yaml, markdown, json]
args: ['--prose-wrap=never', '--tab-width', '2', '--single-quote'] # Following django-cookiecutter
- repo: https://github.com/python-poetry/poetry
rev: 1.7.0
hooks:
- id: poetry-check
- id: poetry-lock
args: ['--check', '--no-update']
- repo: https://github.com/adamchainz/django-upgrade
rev: '1.15.0'
hooks:
- id: django-upgrade
args: ['--target-version', '4.2']
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py311-plus]
- repo: https://github.com/hadialqattan/pycln
rev: v2.4.0
hooks:
- id: pycln
args: [--config=pyproject.toml]
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.12.1
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies:
- Flake8-pyproject
- flake8-isort
- repo: https://github.com/PyCQA/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
additional_dependencies: ['pydocstyle[toml]']
args: [--config, ./pyproject.toml]
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.5
hooks:
- id: docformatter
args: [--in-place, --config, ./pyproject.toml]
- repo: https://github.com/PyCQA/bandit
rev: 1.7.6
hooks:
- id: bandit
args: [-c, pyproject.toml]
additional_dependencies: ['bandit[toml]']
- repo: https://github.com/Riverside-Healthcare/djLint
rev: v1.34.1
hooks:
- id: djlint-reformat-django
args: ['--configuration', './pyproject.toml']
- id: djlint-django
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
args: [--config-file, ./pyproject.toml]
verbose: true
entry: bash -c 'mypy "$@" || true' --
additional_dependencies:
- types-python-dateutil
- django-stubs[compatability-mypy]
- python-dotenv
- whitenoise
- django-extensions
- django-debug-toolbar
- azure-storage-blob
- django_pandas
- tqdm
- psycopg[binary]
- validators
# sets up .pre-commit-ci.yaml to ensure pre-commit dependencies stay up to date
ci:
autoupdate_schedule: weekly
skip: [mypy]
submodules: false