Skip to content

Commit 97f8895

Browse files
committed
add golangci-lint to project
fix #792 Signed-off-by: Mahmoud <mahmud.tehrani@gmail.com>
1 parent ac46e07 commit 97f8895

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed

.golangci.yml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# output configuration options
2+
output:
3+
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
4+
format: colored-line-number
5+
6+
# print lines of code with issue, default is true
7+
print-issued-lines: true
8+
9+
# print linter name in the end of issue text, default is true
10+
print-linter-name: true
11+
12+
linters:
13+
# please, do not use `enable-all`: it's deprecated and will be removed soon.
14+
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
15+
disable-all: true
16+
enable:
17+
- bodyclose
18+
- deadcode
19+
- depguard
20+
- dogsled
21+
- dupl
22+
- errcheck
23+
- funlen
24+
- gochecknoinits
25+
- goconst
26+
- gocritic
27+
- gocyclo
28+
- gofmt
29+
- goimports
30+
- golint
31+
- gomnd
32+
- goprintffuncname
33+
- gosec
34+
- gosimple
35+
- govet
36+
- ineffassign
37+
- interfacer
38+
- lll
39+
- misspell
40+
- nakedret
41+
- rowserrcheck
42+
- scopelint
43+
- staticcheck
44+
- structcheck
45+
- stylecheck
46+
- typecheck
47+
- unconvert
48+
- unparam
49+
- unused
50+
- varcheck
51+
- whitespace
52+
- gocognit
53+
- godox
54+
- maligned
55+
- prealloc
56+
- wsl
57+
- godot
58+
- nestif
59+
- gomodguard
60+
- asciicheck
61+
62+
issues:
63+
# Excluding configuration per-path, per-linter, per-text and per-source
64+
exclude-rules:
65+
- path: _test\.go
66+
linters:
67+
- gomnd
68+
- path: test
69+
linters:
70+
- gomnd
71+
- dupl

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ verify:
8989
hack/verify-gencode.sh
9090
hack/verify-vendor.sh
9191

92+
lint: ## Lint the files
93+
golangci-lint version
94+
golangci-lint run pkg/kube pkg/version pkg/apis/...
95+
9296
verify-generated-yaml:
9397
./hack/check-generated-yaml.sh
9498

0 commit comments

Comments
 (0)