Skip to content

Commit 5bb40e0

Browse files
committed
update pre-commit
1 parent b657da5 commit 5bb40e0

2 files changed

Lines changed: 40 additions & 16 deletions

File tree

.pre-commit-config.yaml

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,37 @@
11
repos:
2-
- repo: https://github.com/tekwizely/pre-commit-golang
3-
rev: v1.0.0-beta.5
2+
- repo: local
43
hooks:
5-
- id: my-cmd
6-
name: golines
7-
args: [golines, '-m', '80', '-w', '--']
8-
always_run: false
9-
verbose: false
10-
- id: go-build-repo-mod
11-
- id: go-test-repo-mod
12-
- id: go-imports
13-
- id: my-cmd
14-
name: gofumpt
15-
args: [gofumpt, '-w', '--']
16-
always_run: false
17-
verbose: false
18-
- id: golangci-lint-repo-mod
4+
- id: go-mod-tidy
5+
name: go mod tidy
6+
entry: go mod tidy
7+
language: system
8+
files: \.go$
9+
pass_filenames: false
10+
11+
- id: go-fmt
12+
name: format code
13+
entry: just fmt
14+
language: system
15+
files: \.go$
16+
pass_filenames: false
17+
18+
- id: golangci-lint
19+
name: lint code
20+
entry: just lint
21+
language: system
22+
files: \.go$
23+
pass_filenames: false
24+
25+
- id: govulncheck
26+
name: vulnerability check
27+
entry: just vulncheck
28+
language: system
29+
files: \.go$
30+
pass_filenames: false
31+
32+
- id: go-test
33+
name: run tests
34+
entry: just test
35+
language: system
36+
files: \.go$
37+
pass_filenames: false

justfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ build-win:
7070
lint:
7171
@{{toolprefix}} golangci-lint run ./...
7272

73+
fmt:
74+
@{{toolprefix}} gofumpt -l -w .
75+
@{{toolprefix}} goimports -w .
76+
@{{toolprefix}} golines -w .
77+
7378
vulncheck:
7479
@go tool -modfile=tools.mod govulncheck ./...
7580

0 commit comments

Comments
 (0)