-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.pre-commit-config.yaml
157 lines (142 loc) · 3.91 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
exclude: "^docs/|.idea|devcontainer.json|tests/fixtures|tests/.*snapshots/.*\\.(json|html|xml|opml)|manifest.json"
default_stages: [pre-commit]
default_language_version:
python: python3.12
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-docstring-first
- id: check-shebang-scripts-are-executable
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-json
exclude: (\.vscode)
- id: check-toml
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: detect-private-key
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: insert-license
name: Insert license header on Python files
files: ^legadilo/.*\.py$
args:
- --license-filepath
- "./devops/license-header-template.txt"
- --use-current-year
- --allow-past-years
- id: insert-license
name: Insert license header on JS files
files: ^legadilo/.*\.js$
exclude: theme_chooser\.js$
args:
- --license-filepath
- "./devops/license-header-template.txt"
- --comment-style
- "//"
- --use-current-year
- --allow-past-years
- repo: https://github.com/adamchainz/django-upgrade
rev: "1.22.1"
hooks:
- id: django-upgrade
args: ["--target-version", "5.0"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.0
hooks:
- id: pyupgrade
args: [--py312-plus]
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.8.1
hooks:
- id: ruff
args: [--fix, --preview]
- id: ruff-format
args: [--preview]
- repo: https://github.com/seddonym/import-linter
rev: v2.1
hooks:
- id: import-linter
- repo: https://github.com/Riverside-Healthcare/djLint
rev: v1.36.1
hooks:
- id: djlint-reformat-django
exclude: "ninja/swagger.html"
- id: djlint-django
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
exclude: ".envrc"
args: [-e, SC1091]
- repo: https://github.com/thibaudcolas/pre-commit-stylelint
rev: v16.10.0
hooks:
- id: stylelint
args: [--fix]
additional_dependencies:
- repo: https://github.com/pre-commit/mirrors-eslint
rev: "v9.15.0"
hooks:
- id: eslint
args: [--fix]
additional_dependencies:
- "@eslint/[email protected]"
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.1.0"
hooks:
- id: prettier
types_or: [yaml, css, javascript, json]
exclude: (\.vscode)
- repo: local
hooks:
- id: mypy
name: mypy
entry: env
args:
- DATABASE_URL=sqlite:///mypy.db
- IS_PRODUCTION=True
- DJANGO_SECRET_KEY=test-key
- DJANGO_ADMIN_URL=admin/
- uv
- run
- mypy
- legadilo
- config
language: system
types: [python]
pass_filenames: false
- repo: local
hooks:
- id: pytest
name: pytest
entry: env
args:
- uv
- run
- pytest
language: system
types: [python]
pass_filenames: false
stages:
- pre-push
# sets up .pre-commit-ci.yaml to ensure pre-commit dependencies stay up to date
ci:
autoupdate_schedule: weekly
skip: []
submodules: false