-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.pre-commit-config.yaml
106 lines (98 loc) · 2.58 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
default_language_version:
python: python3.12
exclude: |
(?x)(
CHANGELOG.md|
canvas_sdk/value_set/v2022/
)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: end-of-file-fixer
exclude_types:
- svg
exclude: &generated canvas_generated/
- id: trailing-whitespace
args: ["--markdown-linebreak-ext=md"]
exclude_types:
- svg
- id: mixed-line-ending
args: ["--fix=lf"]
exclude_types:
- batch
- id: fix-byte-order-marker
- repo: https://github.com/pappasam/toml-sort
rev: v0.24.2
hooks:
- id: toml-sort
args: [--in-place, --all]
exclude: |
(?x)(
uv.lock
)$
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.4
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format
exclude: *generated
- repo: https://github.com/rtts/djhtml
rev: 3.0.7
hooks:
- id: djhtml
# Indent only HTML files in template directories
files: .*/templates/.*\.html$
args: ["--tabwidth=2"]
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
args: ["-x", "-e", "SC1091"]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: name-tests-test
args: ["--django"]
exclude: |
(?x)(
tests/(factories|fixtures|utils)|
tests/.*/utils/.*\.py|
tests/.*/snapshots/.*\.py|
tests/.*/_.*\.py
)
- id: debug-statements
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: detect-private-key
- id: check-executables-have-shebangs
- id: check-builtin-literals
- id: check-docstring-first
- id: check-ast
- id: check-json
- id: check-toml
- id: check-yaml
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.1
hooks:
- id: mypy
exclude: |
(?x)(
canvas_generated/|
canvas_cli/templates/
)
entry: |
bash -c "
python -m pip install --upgrade pip setuptools wheel uv \
&& uv sync \
&& exec uv run mypy --show-traceback $@
"
- repo: local
hooks:
- id: check-protobufs-definitions
name: Check Protobufs Definitions
entry: uv run ./bin/generate-protobufs
language: system
pass_filenames: false