-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
151 lines (133 loc) · 4.29 KB
/
.pre-commit-config.yaml
File metadata and controls
151 lines (133 loc) · 4.29 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
repos:
- repo: local
hooks:
# Bazel file formatting with buildifier
- id: buildifier
name: Buildifier
description: Format Bazel files with buildifier
entry: bazel run //:buildifier
language: system
files: '\.(bzl|bazel|BUILD)$'
pass_filenames: false
# Python formatting and linting
- repo: https://github.com/psf/black
rev: 25.1.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/pycqa/isort
rev: 6.0.1
hooks:
- id: isort
args: ["--profile", "black"]
# Rust formatting via local toolchain
- repo: local
hooks:
- id: rustfmt
name: Rust Format
description: Format Rust files with rustfmt
entry: rustfmt
language: system
files: '\.rs$'
# Go formatting
- repo: https://github.com/dnephin/pre-commit-golang
rev: v0.5.1
hooks:
- id: go-fmt
# JavaScript/TypeScript/Documentation formatting
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
files: '\.(js|ts|jsx|tsx|json|yaml|yml|md|mdx|astro|css)$'
exclude: '(package-lock\.json|\.lock)$'
additional_dependencies:
- "prettier-plugin-astro@^0.14.0"
# Markdown linting
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.42.0
hooks:
- id: markdownlint
args: ["--fix"]
files: '\.(md|mdx)$'
exclude: "^docs-site/node_modules/"
# General file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: '\.patch$'
- id: end-of-file-fixer
exclude: '\.patch$'
- id: check-yaml
exclude: '\.md$'
- id: check-toml
- id: check-json
- id: check-merge-conflict
- id: check-case-conflict
- id: check-added-large-files
args: ["--maxkb=1000"]
- id: detect-private-key
# Conventional commits validation
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v4.2.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: [feat, fix, docs, style, refactor, perf, test, build, ci, chore]
# Security checks
# Temporarily disabled - flagging legitimate SHA256 hashes and git commits
# - repo: https://github.com/Yelp/detect-secrets
# rev: v1.5.0
# hooks:
# - id: detect-secrets
# args: ['--baseline', '.secrets.baseline']
# Custom local hooks
- repo: local
hooks:
# Rust clippy linting via Bazel
- id: rust-clippy
name: Rust Clippy
description: Run clippy on all Rust code via Bazel
entry: bazel build //:clippy
language: system
files: '\.rs$'
pass_filenames: false
# WIT file validation
- id: wit-validation
name: WIT File Validation
description: Validate WIT files are syntactically correct
entry: bash -c 'for file in "$@"; do echo "Validating $file"; done'
language: system
files: '\.wit$'
# Bazel build test for changed files
- id: bazel-test-changed
name: Bazel Test Changed
description: Run tests for changed Bazel targets
entry: bash -c 'echo "Running tests for changed files..." && bazel test //test/unit:unit_tests'
language: system
files: '\.bzl$|\.bazel$|BUILD$'
pass_filenames: false
# Documentation build validation
- id: docs-build-check
name: Documentation Build Check
description: Validate documentation builds successfully
entry: bash -c 'cd docs-site && npm run check'
language: system
files: '^docs-site/.*\.(js|ts|astro|mdx|md|json)$'
pass_filenames: false
# Documentation link validation
- id: docs-link-check
name: Documentation Link Check
description: Check for broken internal links in documentation
entry: bash -c 'cd docs-site && npm run check'
language: system
files: '^docs-site/.*\.(mdx|md)$'
pass_filenames: false
ci:
autofix_commit_msg: |
style: auto fixes from pre-commit hooks
🤖 Generated with pre-commit
autoupdate_commit_msg: |
chore: update pre-commit hooks
🤖 Generated with pre-commit