-
Notifications
You must be signed in to change notification settings - Fork 1
/
.pre-commit-config.yaml
76 lines (74 loc) · 2.15 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
exclude: '.git'
default_stages: [pre-commit]
ci:
autofix_prs: false
skip:
- oxipng
repos:
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
- repo: https://github.com/shssoichiro/oxipng
rev: v9.1.2
hooks:
- id: oxipng
# - repo: https://github.com/markdownlint/markdownlint
# rev: 'v0.11.0'
# hooks:
# - id: markdownlint
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-merge-conflict # validate no merge conflict strings
- id: check-json # validate json
- id: check-yaml # validate yaml
- id: check-added-large-files # reject giant files (default=500kB)
args: ['--maxkb=600']
- id: detect-private-key # keep those keys safe
- id: end-of-file-fixer # add newline at end of files
- id: trailing-whitespace # trim trailing whitespace
####################
# PYTHON
####################
- repo: https://github.com/adamchainz/django-upgrade
rev: '1.21.0'
hooks:
- id: django-upgrade
args: [--target-version, '5.0']
- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
hooks:
- id: pyupgrade
args: ['--py311-plus']
- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black
args: ['--config=code-examples/dj-scratch/pyproject.toml']
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: ['--settings-file=code-examples/dj-scratch/pyproject.toml']
- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
hooks:
- id: flake8
args: ['--config=code-examples/dj-scratch/.flake8']
additional_dependencies:
[
'flake8-broken-line',
'flake8-bugbear',
'flake8-builtins',
'flake8-comprehensions',
'flake8-pytest-style',
'flake8-return',
'flake8-tuple',
'pep8-naming',
]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
hooks:
- id: mypy
args: ['--config-file=code-examples/dj-scratch/pyproject.toml']