forked from cloudposse/atmos
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
91 lines (81 loc) · 3.46 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
91 lines (81 loc) · 3.46 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
default_install_hook_types: [pre-commit]
default_stages: [pre-commit]
repos:
# Go-specific hooks
- repo: https://github.com/tekwizely/pre-commit-golang
rev: v1.0.0-rc.1
hooks:
- id: go-fumpt
args: [-w]
exclude: ^(vendor/|tests/test-cases/|tests/testdata/|tests/snapshots/)
- id: go-build-mod
name: Check Go build
description: Ensure code compiles before commit
- id: go-mod-tidy
name: Tidy go.mod
description: Ensure go.mod and go.sum are clean
# Run golangci-lint using system binary to avoid Go version compatibility issues
- repo: local
hooks:
- id: golangci-lint-config-verify
name: golangci-lint config verify
description: Validate golangci-lint configuration file schema
entry: golangci-lint config verify
language: system
files: ^\.golangci\.yml$
pass_filenames: false
# IMPORTANT: Do NOT build custom-gcl automatically in this hook!
# Building during pre-commit can cause git corruption in worktrees.
# Users should run `make custom-gcl` once before committing.
# The run script will provide helpful error if binary is missing.
- id: golangci-lint
name: golangci-lint
description: Run golangci-lint on modified Go files (requires pre-built custom-gcl binary)
entry: scripts/run-custom-golangci-lint.sh
language: system
types: [go]
pass_filenames: false
require_serial: true
exclude: ^(vendor/|tests/test-cases/|tests/testdata/|tests/snapshots/)
- id: gomodcheck
name: Check go.mod install compatibility
description: Ensure go.mod doesn't have replace/exclude directives that break go install
entry: bash -c 'cd tools/gomodcheck && go run . ../../go.mod'
language: system
files: ^go\.mod$
pass_filenames: false
- id: claude-md-size-check
name: Check CLAUDE.md size limit
description: Ensure CLAUDE.md files stay under 40KB size limit
entry: scripts/check-claude-md-size.sh
language: system
files: ^(CLAUDE\.md|\.conductor/.*/CLAUDE\.md)$
pass_filenames: false
- id: tracked-symlinks-check
name: Verify tracked symlinks
description: Ensure every Git-tracked symbolic link resolves
entry: scripts/check-symlinks.sh
language: system
pass_filenames: false
always_run: true
# General file hygiene
# NOTE: trailing-whitespace, end-of-file-fixer, and check-added-large-files hardcode
# `stages: [commit, push, manual]` upstream, which overrides our repo-level
# default_stages - so they need an explicit stages: override here to stay
# commit-only like every other hook.
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
stages: [pre-commit]
exclude: ^(vendor/|tests/test-cases/|tests/testdata/|tests/snapshots/|.*\.svg|website/src/components/Screengrabs/)
- id: end-of-file-fixer
stages: [pre-commit]
exclude: ^(vendor/|tests/test-cases/|tests/testdata/|tests/snapshots/|.*\.svg|website/src/components/Screengrabs/)
- id: check-yaml
exclude: ^(vendor/|tests/test-cases/|tests/testdata/|tests/snapshots/|tests/fixtures/)
args: [--allow-multiple-documents, --unsafe]
- id: check-added-large-files
stages: [pre-commit]
args: [--maxkb=500]
exclude: ^(docs/demo.gif|website/)