-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
60 lines (53 loc) · 1.71 KB
/
.pre-commit-config.yaml
File metadata and controls
60 lines (53 loc) · 1.71 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
# .pre-commit-config.yaml
# See https://pre-commit.com for more information
default_install_hook_types: [pre-commit, pre-push]
repos:
# Pre-commit hooks (fast checks, run on every commit)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: local
hooks:
- id: go-fmt
name: go fmt
entry: bash -c 'for d in $(for f in "$@"; do dirname "$f"; done | sort -u); do go fmt ./"$d" || exit 1; done' --
language: system
types: [go]
pass_filenames: true
stages: [pre-commit]
- id: golines
name: golines (max 100 chars)
entry: golines
language: golang
additional_dependencies: [github.com/segmentio/golines@latest]
args: [-w, --max-len=100]
types: [go]
stages: [pre-commit]
# Pre-push hooks (comprehensive checks, run before push)
- repo: local
hooks:
- id: go-vet
name: go vet
entry: bash -c 'pkgs=$(for f in "$@"; do echo "./$(dirname "$f")"; done | sort -u); go vet $pkgs' --
language: system
types: [go]
pass_filenames: true
stages: [pre-push]
- id: rayci-lint-coverage
name: rayci-lint go-coverage
entry: go run ./raycilint/raycilint go-coverage
language: system
types: [go]
pass_filenames: false
stages: [pre-push]
- id: rayci-lint-filelength
name: rayci-lint go-filelength
entry: go run ./raycilint/raycilint go-filelength
language: system
types: [go]
pass_filenames: false
stages: [pre-push]