-
Notifications
You must be signed in to change notification settings - Fork 71
Expand file tree
/
Copy pathprek.toml
More file actions
57 lines (52 loc) · 1.85 KB
/
Copy pathprek.toml
File metadata and controls
57 lines (52 loc) · 1.85 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
# Prek Configuration for this operator
# https://prek.j178.dev/
# File hygiene and syntax validation
[[repos]]
repo = "builtin"
hooks = [
{ id = "trailing-whitespace", args = ["--markdown-linebreak-ext=md"], exclude = "^(boilerplate/|test/e2e/|\\.pre-commit-config\\.yaml)" },
{ id = "end-of-file-fixer", exclude = "^(boilerplate/|test/e2e/|\\.pre-commit-config\\.yaml)" },
{ id = "check-added-large-files", args = ["--maxkb=1024"] },
{ id = "check-case-conflict" },
{ id = "check-merge-conflict" },
{ id = "check-json" },
{ id = "check-yaml", args = ["--allow-multiple-documents"] },
{ id = "check-toml" },
]
# Local custom hooks
# Note: Gitleaks secret scanning is configured in hack/prek.ci.toml for CI only.
# To enable locally, install gitleaks and add it here as a local system hook.
[[repos]]
repo = "local"
hooks = [
# Go build check
{
id = "go-build",
name = "go build",
language = "system",
entry = "bash -c 'T=$(command -v timeout || command -v gtimeout || echo); ${T:+$T 30s} go build ./...'",
types = ["go"],
pass_filenames = false
},
# Go mod tidy check
{
id = "go-mod-tidy",
name = "go mod tidy",
language = "system",
entry = "bash -c 'T=$(command -v timeout || command -v gtimeout || echo); ${T:+$T 60s} go mod tidy && git diff --exit-code go.mod go.sum'",
files = '(\.go$|go\.(mod|sum)$)',
pass_filenames = false
},
# RBAC wildcard check
{
id = "rbac-wildcard-check",
name = "RBAC wildcard permissions",
language = "system",
entry = "bash -c 'make rbac-wildcard-check'",
files = '^deploy/.*\.ya?ml$',
pass_filenames = false
},
# Note: golangci-lint is run via 'make go-check' and CI, not in prek
# The boilerplate golangci.yml requires golangci-lint v2, which is built with Go 1.25
# and cannot analyze this repo's Go 1.26 code. This is a known limitation.
]