-
Notifications
You must be signed in to change notification settings - Fork 1
/
.pre-commit-config.yaml
49 lines (44 loc) · 1.38 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
40
41
42
43
44
45
46
47
48
49
repos:
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.3.0
hooks:
- id: pretty-format-golang
name: Format golang code
args:
- --autofix
- repo: https://github.com/golangci/golangci-lint
rev: v1.53.3
hooks:
- id: golangci-lint
name: Check lint issues
entry: golangci-lint run
args:
- --max-issues-per-linter=0
- --max-same-issues=0
- --config=.golangci.yaml
- --new-from-rev=HEAD~1 # comment this arg if you want to run pre-commit run --all-files
# - --verbose
- ./pkg/...
# verbose: true
- repo: local
hooks:
- id: prepare-database-container
name: Prepare DB Containers
entry: ./scripts/test-db-pre-commit.sh
language: script
- id: golang-clean-tests
name: Go Clean Tests
entry: go clean -testcache
pass_filenames: false
types: [go]
language: system
- id: golang-unit-tests
name: Go Unit Tests
entry: go test ./... -covermode=atomic -coverprofile=/tmp/coverage.out -coverpkg=./... -count=1
pass_filenames: false
types: [go]
language: system
- id: remove-database-container
name: Remove DB Containers
entry: ./scripts/test-db-down.sh
language: script