-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
133 lines (119 loc) · 4.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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
# Apply to all files without commiting:
# pre-commit run --all-files
# Update this file:
# pre-commit autoupdate
default_language_version:
python: python3.11
exclude: .*migrations\/.*
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-added-large-files
args:
- --maxkb=128
- id: check-ast # Simply checks whether the files parse as valid python
- id: check-builtin-literals # Requires literal syntax when initializing empty or zero python builtin types
- id: check-case-conflict # Check for filenames that would conflict on a case-insensitive filesystem
- id: check-docstring-first # Checks a common error of defining a docstring after code
- id: check-executables-have-shebangs # Ensures that (non-binary) executables have a shebang
- id: check-json # Checks json files for parseable syntax
- id: check-merge-conflict # Checks for files that contain merge conflict strings
- id: check-toml # Checks toml files for parseable syntax
- id: check-xml # Checks xml files for parseable syntax
- id: check-yaml # Checks yaml files for parseable syntax
- id: debug-statements # Check for debugger imports and py37+ `breakpoint()` calls in Python source.
- id: detect-private-key # Detects the presence of private keys
- id: end-of-file-fixer # Ensures that a file is either empty, or ends with one newline
exclude: ".svg$"
- id: file-contents-sorter # Sorts the lines in specified files (defaults to alphabetical)
args: ["--ignore-case", "--unique"]
files: ^(requirements[-\w]*.txt)$
- id: fix-byte-order-marker # Forbid UTF-8 byte-order
- id: mixed-line-ending # Replaces or checks mixed line ending
args: ["--fix=lf"]
- id: name-tests-test # Verifies that test files are named correctly
args:
- --django
exclude: ^tests/testapp|^tests/management/|^tests/collisions/|^tests/pythonrc.py
- id: pretty-format-json # Sets a standard for formatting json files
- id: trailing-whitespace # Trims trailing whitespace
exclude: ".md$|.email$"
# - repo: https://github.com/asottile/pyupgrade
# rev: v3.16.0
# hooks:
# - id: pyupgrade
# args: [--py311-plus]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.5.2"
hooks:
- id: ruff
args:
- --fix
# - repo: https://github.com/psf/black
# rev: 23.3.0
# hooks:
# - id: black
# language_version: python3.11
- repo: https://github.com/asottile/blacken-docs
rev: 1.18.0
hooks:
- id: blacken-docs
additional_dependencies: [black==22.3.0]
- repo: https://github.com/PyCQA/flake8
rev: 7.1.0
hooks:
- id: flake8
additional_dependencies: [flake8-docstrings]
- repo: https://github.com/PyCQA/isort
rev: "5.13.2"
hooks:
- id: isort
args: ["--profile=black"]
# - repo: https://github.com/miki725/importanize
# rev: "0.7"
# hooks:
# - id: importanize
# language_version: python3
# - repo: https://github.com/PyCQA/pydocstyle
# rev: 6de6d938377e2db3bfe6f706fa2e3b90c412db76
# hooks:
# - id: pydocstyle
# - repo: https://github.com/PyCQA/bandit
# rev: "1.6.0"
# hooks:
# - id: bandit
# - repo: https://github.com/prettier/prettier
# rev: "1.18.2"
# hooks:
# - id: prettier
# args: ["--print-width 120"]
# additional_dependencies: ['[email protected]']
# - repo: https://github.com/adrienverge/yamllint
# rev: "v1.16.0"
# hooks:
# - id: yamllint
- repo: https://github.com/trbs/pre-commit-hooks-trbs
rev: 1.2.4
hooks:
- id: forbid-executables
exclude: manage.py|setup.py|docker-entrypoint.sh|compile_python.sh
- repo: https://github.com/Riverside-Healthcare/djLint
rev: v1.34.1
hooks:
- id: djlint-django
- repo: https://github.com/rtts/djhtml
rev: "3.0.6" # replace with the latest tag on GitHub
hooks:
- id: djhtml
entry: djhtml --tabwidth 4
- id: djcss
- id: djjs
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v0.991
# hooks:
# - id: mypy
# additional_dependencies: ["django-stubs", "pydantic"]
# exclude: (tests|docs)/