Skip to content

Commit 1c514ec

Browse files
cloud-vinyl-botclaude
andcommitted
chore: add pre-commit hooks for Go, Helm, and shell
Hooks: - trailing-whitespace, end-of-file-fixer, check-yaml (excl. Helm templates), check-json, check-merge-conflict, check-added-large-files, mixed-line-ending - go fmt, go vet (local, runs from module root) - golangci-lint --fix (local) - helm lint + helm unittest (runs on charts/ changes) - shellcheck (--severity=warning) for setup scripts Run: pre-commit install && pre-commit run --all-files Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 94a3402 commit 1c514ec

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

.pre-commit-config.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
repos:
2+
# General file hygiene
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v5.0.0
5+
hooks:
6+
- id: trailing-whitespace
7+
- id: end-of-file-fixer
8+
- id: check-yaml
9+
args: [--allow-multiple-documents]
10+
exclude: ^charts/.*/templates/
11+
- id: check-json
12+
- id: check-merge-conflict
13+
- id: check-added-large-files
14+
args: [--maxkb=500]
15+
- id: mixed-line-ending
16+
args: [--fix=lf]
17+
18+
# Go: format + vet + lint (local hooks run from the repo root)
19+
- repo: local
20+
hooks:
21+
- id: go-fmt
22+
name: go fmt
23+
language: system
24+
entry: gofmt -l -w
25+
types: [go]
26+
- id: go-vet
27+
name: go vet
28+
language: system
29+
entry: go vet ./...
30+
types: [go]
31+
pass_filenames: false
32+
- id: golangci-lint
33+
name: golangci-lint
34+
language: system
35+
entry: golangci-lint run --fix
36+
types: [go]
37+
pass_filenames: false
38+
39+
# Helm: lint the chart
40+
- repo: local
41+
hooks:
42+
- id: helm-lint
43+
name: helm lint
44+
language: system
45+
entry: helm lint charts/cloud-vinyl/
46+
pass_filenames: false
47+
files: ^charts/
48+
49+
# Helm: unit tests
50+
- repo: local
51+
hooks:
52+
- id: helm-unittest
53+
name: helm unittest
54+
language: system
55+
entry: helm unittest charts/cloud-vinyl/
56+
pass_filenames: false
57+
files: ^charts/
58+
59+
# Shell: shellcheck
60+
- repo: https://github.com/shellcheck-py/shellcheck-py
61+
rev: v0.10.0.1
62+
hooks:
63+
- id: shellcheck
64+
args: [--severity=warning]

0 commit comments

Comments
 (0)