-
-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
153 lines (137 loc) · 3.97 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
153 lines (137 loc) · 3.97 KB
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_install_hook_types: [pre-commit, pre-push]
default_stages: [pre-commit, pre-push]
minimum_pre_commit_version: "2.18"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
# identify invalid files
- id: check-ast
- id: check-yaml
- id: check-json
- id: check-toml
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
# git checks
- id: check-merge-conflict
- id: check-added-large-files
- id: detect-private-key
- id: check-case-conflict
# - id: detect-aws-credentials
# python checks
- id: check-docstring-first
- id: check-builtin-literals
- id: debug-statements
- id: requirements-txt-fixer
- id: fix-byte-order-marker
- id: name-tests-test
args: [--pytest-test-first]
# general quality checks
- id: mixed-line-ending
args: [--fix=lf]
exclude: ^app/core/initial_data/
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: check-executables-have-shebangs
- id: end-of-file-fixer
- repo: https://github.com/AleksaC/hadolint-py
rev: v2.14.0
hooks:
- id: hadolint
- repo: https://github.com/asottile/pyupgrade
rev: v3.21.2
hooks:
- id: pyupgrade
args: [--py310-plus]
- repo: https://github.com/adamchainz/django-upgrade
rev: 1.30.0
hooks:
- id: django-upgrade
args: [--target-version, "4.0"]
- repo: https://github.com/pycqa/flake8
rev: 7.3.0
hooks:
- id: flake8
exclude: "^app/core/migrations/|^app/data/migrations/|^app/core/scripts"
args: [--max-line-length=119, --max-complexity=4]
additional_dependencies:
[
dlint,
flake8-use-fstring,
flake8-variables-names,
]
- repo: https://github.com/pycqa/isort
rev: 8.0.1
hooks:
- id: isort
name: isort (python)
args: ["--filter-files", "--force-single-line-imports"]
- repo: https://github.com/PyCQA/bandit
rev: 1.9.4
hooks:
- id: bandit
exclude: ^app/core/tests/
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.11.0.1
hooks:
- id: shellcheck
# - repo: https://github.com/econchick/interrogate
# rev: 1.4.0
# hooks:
# - id: interrogate
# args: [-vv, -i, --fail-under=80]
# disabled because it reformats this yaml file
# - repo: https://github.com/mxr/sync-pre-commit-deps
# rev: v0.0.1
# hooks:
# - id: sync-pre-commit-deps
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.15.9
hooks:
# Run the linter.
- id: ruff-check
args: [--fix, --select,
B, # flake8-bugbear
A, # flake8-builtin
C4, # flake8-comprehensions
DJ, # flake8-django
EXE, # flake8-executable
FIX, # flake8-fixme
PT, # flake8-pytest-style
TID, # flake8-tidy-imports
PTH, # flake8-use-pathlib
N, # pep8-naming
]
exclude: ^app/core/migrations/
# Run the formatter.
- id: ruff-format
exclude: ^app/core/migrations/
- repo: https://github.com/executablebooks/mdformat
rev: 1.0.0
hooks:
- id: mdformat
additional_dependencies:
- mdformat-mkdocs[recommended]>=5.1.4
- repo: local
hooks:
- id: buildrun
name: buildrun
entry: ./scripts/buildrun.sh
language: system
pass_filenames: false
always_run: true
stages: [pre-push]
- id: test
name: test
entry: ./scripts/test.sh
language: system
pass_filenames: false
always_run: true
# verbose: true
# require_serial: true
stages: [pre-push]
ci:
autoupdate_schedule: quarterly