-
Notifications
You must be signed in to change notification settings - Fork 2
/
.golangci.yml
65 lines (63 loc) · 2.37 KB
/
.golangci.yml
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
61
62
63
64
65
linters:
enable:
- lll
- bodyclose # Checks whether HTTP response body is closed successfully.
- ginkgolinter # Enforces standards of using ginkgo and gomega.
- goconst # Finds repeated strings that could be replaced by a constant.
- gofmt # Checks whether code is gofmted.
- revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint.
- stylecheck # Checks whether code follows go style recommendations.
- prealloc # Finds slice declarations that could potentially be preallocated.
- perfsprint # Checks for sprint() calls in frequently executed code.
- goconst # Finds repeated strings that could be replaced by a constant.
- depguard # Checks whether dependencies are used directly or via a wrapper.
- goimports # Checks missing or unreferenced package imports.
- gocyclo # Detects functions or methods with high cyclomatic complexity.
- whitespace # Checks for redundant whitespaces in code.
- misspell # Finds commonly misspelled English words.
- dupword
- errname
- gosec
- goimports
- gocognit
- godot
- importas
linters-settings:
importas:
no-unaliased: true
# no-extra-aliases: true
alias:
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1
alias: metav1
- pkg: k8s.io/api/core/v1
alias: corev1
gocognit:
# Minimal code complexity to report.
# Default: 30 (but we recommend 10-20)
min-complexity: 20
lll:
line-length: 290
tab-width: 4
misspell:
locale: US
depguard:
rules:
logger:
list-mode: lax # allowed by default unless explicitly denied
deny:
- pkg: "github.com/sirupsen/logrus"
desc: "logger is only allowed to be used under logger wrapper package pkg/logger"
- pkg: "go.uber.org/zap"
desc: "logger is only allowed to be used under logger wrapper package pkg/logger"
- pkg: "github.com/rs/zerolog"
desc: "logger is only allowed to be used under logger wrapper package pkg/logger"
run:
tests: false
timeout: 5m
issues:
# The default exclusion rules are a bit too permissive, so copying the relevant ones below
exclude-use-default: true
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
max-issues-per-linter: 0
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
max-same-issues: 0