-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathprek.toml
More file actions
78 lines (71 loc) · 2.1 KB
/
Copy pathprek.toml
File metadata and controls
78 lines (71 loc) · 2.1 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
# Prek Configuration for OCM Agent 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" },
]
# Red Hat InfoSec security scanning
[[repos]]
repo = "https://gitlab.cee.redhat.com/infosec-public/developer-workbench/tools.git"
rev = "rh-pre-commit-2.3.0"
hooks = [
{ id = "rh-pre-commit", stages = ["pre-commit"] },
]
# Gitleaks secret scanning
[[repos]]
repo = "https://github.com/gitleaks/gitleaks"
rev = "v8.18.0"
hooks = [
{ id = "gitleaks", args = ["--config=.gitleaks.toml"] },
]
# golangci-lint static analysis
[[repos]]
repo = "https://github.com/golangci/golangci-lint"
rev = "v2.7.2"
hooks = [
{ id = "golangci-lint", args = [
"--config=boilerplate/openshift/golang-osd-operator/golangci.yml",
"--timeout=120s"
] },
]
# Local custom hooks
[[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
},
]