generated from hackforla/.github-hackforla-base-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
.pre-commit-config.yaml
171 lines (153 loc) · 4.37 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# 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: v5.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-encoding-pragma
args: [--remove]
- id: fix-byte-order-marker
- id: name-tests-test
args: [--pytest-test-first]
# general quality checks
- id: mixed-line-ending
- 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.12.1b3
hooks:
- id: hadolint
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.0
hooks:
- id: pyupgrade
args: [--py310-plus]
- repo: https://github.com/adamchainz/django-upgrade
rev: 1.22.2
hooks:
- id: django-upgrade
args: [--target-version, "4.0"]
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.10.0
hooks:
- id: black
exclude: ^app/core/migrations/
- repo: https://github.com/adamchainz/blacken-docs
rev: 1.19.1
hooks:
- id: blacken-docs
additional_dependencies:
- black==24.10.0
- repo: https://github.com/pycqa/flake8
rev: 7.1.1
hooks:
- id: flake8
exclude: "^app/core/migrations/|^app/data/migrations/|^app/core/scripts"
args: [--max-line-length=119, --max-complexity=4, --pytest-fixture-no-parentheses]
additional_dependencies:
[
flake8-bugbear,
dlint,
flake8-use-fstring,
flake8-builtins,
pep8-naming,
flake8-variables-names,
flake8-fixme,
flake8-executable,
flake8-pytest-style,
flake8-django,
flake8-comprehensions,
flake8-tidy-imports,
]
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
args: ["--filter-files", "--force-single-line-imports"]
- repo: https://github.com/PyCQA/bandit
rev: 1.8.0
hooks:
- id: bandit
exclude: ^app/core/tests/
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.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.8.1
hooks:
# Run the linter.
- id: ruff
args: [--fix]
exclude: ^app/core/migrations/
# Run the formatter.
- id: ruff-format
exclude: ^app/core/migrations/
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.19
hooks:
- id: mdformat
exclude: |
(?x)^(
.github/ISSUE_TEMPLATE/|
docs/index.md$|
docs/license.md$
)
additional_dependencies:
- mdformat-admon
- mdformat-mkdocs[recommended]>=2.0.0
- 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