Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 7d2ec59

Browse files
committed
chore: add golangci-lint task and config
Signed-off-by: Yves Brissaud <yves.brissaud@docker.com>
1 parent e776e28 commit 7d2ec59

2 files changed

Lines changed: 47 additions & 0 deletions

File tree

.golangci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
linters:
2+
enable: # defaults @ top
3+
- errcheck
4+
- gosimple
5+
- govet
6+
- ineffassign
7+
- staticcheck
8+
- typecheck
9+
- unused
10+
- unconvert
11+
- gofmt
12+
- misspell
13+
- bodyclose
14+
- revive
15+
- gocyclo
16+
- whitespace
17+
- sqlclosecheck
18+
- goimports
19+
- unparam
20+
run:
21+
deadline: 2m
22+
allow-parallel-runners: true
23+
concurrency: 2
24+
tests: true
25+
linters-settings:
26+
gosimple:
27+
go: '1.19'
28+
staticcheck:
29+
go: '1.19'
30+
stylecheck:
31+
go: '1.19'
32+
unused:
33+
go: '1.19'
34+
revive:
35+
rules:
36+
- name: exported
37+
disabled: true
38+
issues:
39+
max-issues-per-linter: 0
40+
max-same-issues: 0
41+
exclude-use-default: false
42+
output:
43+
format: tab

Taskfile.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ tasks:
2929
- gofmt -w .
3030
#- go mod tidy
3131

32+
go:lint:
33+
cmds:
34+
- docker run --rm -v $(pwd):/app -v $(go env GOPATH)/pkg:/go/pkg -v $(go env GOCACHE):/cache/go -e GOCACHE=/cache/go -e GOLANGCI_LINT_CACHE=/cache/go -w /app golangci/golangci-lint:v1.50.1 golangci-lint run -v --timeout 10m
35+
3236
go:release:
3337
cmds:
3438
- goreleaser release --rm-dist

0 commit comments

Comments
 (0)