-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
188 lines (181 loc) · 6.17 KB
/
.pre-commit-config.yaml
File metadata and controls
188 lines (181 loc) · 6.17 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
exclude: ^.idea
default_language_version:
python: python3.14
ruby: 2.7.6
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # v6.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-json
exclude: \.oxlintrc\.json$ # JSONC: oxlint config supports inline comments.
- id: check-shebang-scripts-are-executable
exclude: (\.rs$|\.tftpl$) # Rust inner attributes, Terraform templates
- id: pretty-format-json
args:
- --autofix
- --no-sort-keys
exclude: (package\.json|package-lock\.json|pnpm-lock\.yaml|tsconfig\.json|turbo\.json|\.oxlintrc\.json)
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-vcs-permalinks
- id: check-xml
- id: check-yaml
- id: destroyed-symlinks
- id: detect-private-key
exclude: tests/assets/auth/test_private_key\.pem$
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: forbid-submodules
- id: mixed-line-ending
- id: no-commit-to-branch
- id: trailing-whitespace
exclude_types: [ markdown ]
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: 996abf60411a8d954288ac9856aae7602b80cbda # v0.22.1
hooks:
- id: markdownlint-cli2
args: [--no-globs]
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 38980559e3a605691d6579f96222c30778e5a69e # 3.0.0
hooks:
- id: forbid-binary
exclude: ^(apps/landing/public/(favicon|apple-touch-icon|icon-|og/))
- id: script-must-have-extension
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: ad1b27d73581aa16cca06fc4a0761fc563ffe8e8 # v1.5.6
hooks:
- id: chmod
args: [ '755' ]
files: \.sh$
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: 745eface02aef23e168a8afb6b5737818efbea95 # v0.11.0.1
hooks:
- id: shellcheck
args: [ '-x' ]
exclude: \.tftpl$ # Terraform templates use ${var} interpolation
- repo: https://github.com/bnjbvr/cargo-machete
rev: 7959c845782fed02ee69303126d4a12d64f1db18 # v0.9.1
hooks:
- id: cargo-machete
- repo: https://github.com/rhysd/actionlint
rev: 914e7df21a07ef503a81201c76d2b11c789d3fca # v1.7.12
hooks:
- id: actionlint-system
- repo: local
hooks:
# BASH
- id: bashunit
name: Bash Unit Tests
entry: find scripts/tests -type f -name test_*.sh -exec bashunit {} +
language: system
files: \.sh$
pass_filenames: false
# TERRAFORM
- id: tflint
name: TFLint
entry: scripts/src/git_hooks/tflint.sh
language: script
types_or: [terraform, hcl]
pass_filenames: false
stages:
- pre-commit
# SECURITY
- id: trivy
name: Trivy Scan
entry: scripts/src/git_hooks/trivy.sh
language: script
pass_filenames: false
stages:
- pre-commit
# CLAUDE PLUGIN
- id: claude-plugin-validate
name: Claude Plugin Validate
entry: bash -c 'claude plugin validate . --strict && claude plugin validate ./integrations/claude --strict'
language: system
files: ^(\.claude-plugin/|integrations/claude/)
pass_filenames: false
# RUST
- id: cargo-fmt
name: Cargo Format
entry: cargo +nightly fmt --all -- --check
language: system
types: [ rust ]
pass_filenames: false
- id: cargo-clippy
name: Cargo Clippy
entry: cargo clippy --workspace --tests -- -D warnings
language: system
types: [ rust ]
pass_filenames: false
- id: cargo-audit
name: Cargo Audit
entry: cargo audit
language: system
types: [ rust ]
pass_filenames: false
- id: cargo-coverage
name: Cargo Coverage
entry: scripts/src/git_hooks/cargo_coverage.sh
language: script
types: [ rust ]
pass_filenames: false
- id: check-openapi-spec-drift
name: Check OpenAPI Spec Drift
entry: scripts/src/git_hooks/check_openapi_spec_drift.sh
language: script
files: ^(apps/api/.*\.rs|Cargo\.(toml|lock))$
pass_filenames: false
# LINKS
- id: lychee
name: Lychee
entry: lychee --config .lychee.toml --no-progress
language: system
files: \.(md|astro|mdx)$
exclude: ^(node_modules|apps/landing/dist|.*/dist)/
# LANDING
- id: forbid-is-inline
name: Forbid is:inline
entry: scripts/src/git_hooks/forbid_is_inline.sh
language: script
files: ^apps/landing/.*\.astro$
- id: forbid-raw-raster-img
name: Forbid Raw Raster <img> in src/
entry: scripts/src/git_hooks/forbid_raw_raster_img.sh
language: script
files: ^apps/landing/src/.*\.astro$
pass_filenames: false
# TURBOREPO
- id: turbo-check
name: Turbo Check
entry: bash -c 'TURBO_SCM_BASE=HEAD bun run turbo run check --affected'
language: system
pass_filenames: false
- id: turbo-lint
name: Turbo Lint
entry: bash -c 'TURBO_SCM_BASE=HEAD bun run turbo run lint --affected'
language: system
pass_filenames: false
- id: turbo-format-check
name: Turbo Format Check
entry: bash -c 'TURBO_SCM_BASE=HEAD bun run turbo run format:check --affected'
language: system
pass_filenames: false
- id: turbo-lint-css
name: Turbo Lint CSS
entry: bash -c 'TURBO_SCM_BASE=HEAD bun run turbo run lint:css --affected'
language: system
pass_filenames: false
- id: turbo-test-coverage
name: Turbo Test Coverage
entry: bash -c 'TURBO_SCM_BASE=HEAD bun run turbo run test:coverage --affected'
language: system
pass_filenames: false
- id: turbo-test-lhci
name: Turbo Test LHCI
entry: bash -c 'TURBO_SCM_BASE=HEAD bun run turbo run test:lhci --affected'
language: system
pass_filenames: false