-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
84 lines (79 loc) · 2.5 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
84 lines (79 loc) · 2.5 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
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
# Whitespace / line endings
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix=lf]
# File integrity
- id: check-added-large-files
- id: check-merge-conflict
- id: check-case-conflict
- id: check-symlinks
# Executables / shebangs
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
# Parseable config
- id: check-yaml
- id: check-toml
- id: check-json
# ruff, ty and pytest run via `uv run` so their versions are single-sourced
# from uv.lock — the same binaries CI runs. No second `rev:` to keep aligned.
- repo: local
hooks:
- id: ruff-check
name: ruff check
entry: uv run --no-sync ruff check --fix
language: system
types: [python]
pass_filenames: false
- id: ruff-format
name: ruff format
entry: uv run --no-sync ruff format
language: system
types: [python]
pass_filenames: false
- id: ty
name: ty type check
entry: uv run --no-sync ty check src
language: system
types: [python]
pass_filenames: false
# pytest is a pre-push gate rather than per-commit, so a docs-only
# commit is not held up. CI is the authoritative gate.
- id: pytest
name: pytest
entry: uv run --no-sync pytest -q
language: system
stages: [pre-push]
types: [python]
pass_filenames: false
# The template ships bootstrap, so shell is linted and formatted. Flags match
# CI and ~/.vimrc's ALE config: -i 2 -bn -ci -sr. Note `-i2` is invalid --
# Go's flag parser reads it as a flag named `i2` and shfmt exits non-zero.
- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.11.0
hooks:
- id: shellcheck
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.14.1-1
hooks:
- id: shfmt
args: [-i, "2", -bn, -ci, -sr, -d]
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.26.0
hooks:
- id: commitlint
stages: [commit-msg]
additional_dependencies:
- "@commitlint/config-conventional@^21.2.2"
- repo: https://github.com/rhysd/actionlint
rev: v1.7.12
hooks:
- id: actionlint
- repo: https://github.com/woodruffw/zizmor-pre-commit
rev: v1.30.1
hooks:
- id: zizmor