-
-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
147 lines (130 loc) · 4.13 KB
/
.pre-commit-config.yaml
File metadata and controls
147 lines (130 loc) · 4.13 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
# Pre-commit hooks for rumdl (using prek - https://prek.j178.dev)
# Install with:
# prek install # Installs all hook stages
# Run manually:
# prek run --all-files # Run commit hooks
# prek run --hook-stage pre-push --all-files # Run push hooks
fail_fast: true
repos:
# Secret detection
- repo: https://github.com/gitleaks/gitleaks
rev: v8.30.0
hooks:
- id: gitleaks
# Shell script linting
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
# Conventional Commits validation
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.6.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: [] # Optional: add --strict for stricter validation
# Rust formatting and linting
- repo: local
hooks:
- id: cargo-fmt
name: cargo fmt
entry: mise exec -- cargo fmt --all --
language: system
types: [rust]
pass_filenames: false
- id: cargo-lock-check
name: check Cargo.lock is up-to-date
entry: mise exec -- sh -c 'cargo metadata --locked --format-version 1 --no-deps >/dev/null'
language: system
files: ^Cargo\.(toml|lock)$
pass_filenames: false
stages: [pre-commit]
- repo: https://github.com/rhysd/actionlint
rev: v1.7.7
hooks:
- id: actionlint
# General file quality checks (prek built-in Rust implementations)
- repo: builtin
hooks:
- id: trailing-whitespace
exclude: \.md$|tests/inline_config_test\.rs$|tests/output_format_integration_tests\.rs$|tests/lsp_editor_integration_tests\.rs$|tests/utils_markdown_edge_cases\.rs$
- id: end-of-file-fixer
exclude: \.md$|rumdl\.schema\.json$
- id: check-yaml
- id: check-toml
- id: check-json
- id: check-merge-conflict
- id: check-case-conflict
- id: mixed-line-ending
args: [--fix=lf]
# YAML linting
- repo: https://github.com/owenlamont/ryl-pre-commit
rev: v0.4.0
hooks:
- id: ryl
# Markdown linting using rumdl itself (cargo run)
- repo: local
hooks:
- id: rumdl
name: rumdl check
entry: mise exec -- cargo run --quiet -- check
language: system
files: \.md$
exclude: ^(test_tmp|benchmark/test-data|docs/temp|__tests__|CHANGELOG\.md)
pass_filenames: true
require_serial: true
# Link checking
- repo: local
hooks:
- id: check-links
name: check links
entry: make check-links
language: system
files: \.md$
pass_filenames: false
stages: [pre-push]
# Pre-push hooks for comprehensive validation
- repo: local
hooks:
- id: cargo-test-full
name: cargo test (full suite)
entry: mise exec -- make test-push
language: system
types: [rust]
pass_filenames: false
stages: [pre-push]
- id: cargo-lint-full
name: cargo clippy (all targets)
entry: mise exec -- make lint
language: system
types: [rust]
pass_filenames: false
stages: [pre-push]
- id: cargo-doc-check
name: cargo doc (check)
entry: mise exec -- cargo doc --no-deps --all-features
language: system
types: [rust]
pass_filenames: false
stages: [pre-push]
- id: cargo-lock-check-push
name: verify Cargo.lock is committed and up-to-date
entry: mise exec -- sh -c 'cargo metadata --locked --format-version 1 --no-deps >/dev/null'
language: system
files: ^Cargo\.(toml|lock)$
pass_filenames: false
stages: [pre-push]
- id: complexity-check
name: check for O(n²) regressions
entry: mise exec -- make test-complexity
language: system
types: [rust]
pass_filenames: false
stages: [pre-push]
- id: schema-check
name: check JSON schema is up-to-date
entry: mise exec -- make check-schema
language: system
types: [rust]
pass_filenames: false
stages: [pre-push]