-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy path.pre-commit-config.yaml
39 lines (39 loc) · 1.22 KB
/
.pre-commit-config.yaml
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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_install_hook_types: ["pre-push"]
exclude: '(^vendor|.*golden$)'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: check-added-large-files
- id: check-yaml
args: ["--allow-multiple-documents"]
# Ignore yaml files with {{ }} cause they're not valid.
exclude: '(test\/gohelloworld\/gohelloworld-chart\/templates\/.*yaml$)'
- id: check-shebang-scripts-are-executable
- id: check-json
- id: detect-private-key
# Ignore test yaml files with private key.
exclude: "(.*_test.go|^examples\/v1\/pipelineruns\/beta\/isolated-workspaces.yaml$)"
- repo: local
hooks:
- id: lint-yaml
name: "Lint YAML files"
entry: bash -c 'yamllint -c .yamllint $(find . -path ./vendor -prune -o -type f -regex ".*y[a]ml" -print)'
language: system
types: [yaml]
- id: lint-go
name: "Run make golangci-lint"
entry: make
args: ["golangci-lint"]
language: system
types: [go]
pass_filenames: false
- id: test-unit
name: "Run make test-unit"
entry: make
args: ["test-unit"]
language: system
types: [go]
pass_filenames: false