-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.golangci.yml
124 lines (121 loc) · 3.66 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# Configuration reference: https://golangci-lint.run/usage/configuration/
# Linters reference: https://golangci-lint.run/usage/linters/
run:
build-tags:
- examples
skip-dirs:
- fakeapiserver/cloudexport
- fakeapiserver/synthetics
issues:
max-issues-per-linter: 0
max-same-issues: 0
exclude:
# TODO: These errors should be enabled
- don't use an underscore in package name
- should not use underscores in package names
# EXC0002 golint: Annoying issue about not having a comment. The rare codebase has such comments
- (comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form)
exclude-use-default: false
exclude-rules: # exclude linters impossible to exclude via //nolint
- path: ^kentikapi/models/enum_ # these files are generated and shouldn't be edited with //nolint
linters:
- gochecknoglobals
- lll
- gomnd
# Disabled linters:
# - cyclop - duplicates functionality of gocyclo
# - exhaustivestruct - breaks "Make the zero value useful" proverb, meant to be used only for special cases
# - funlen - not needed - gocyclo ensures that functions complexity is not too high
# - godox - requires all TODOs to be removed - too strict
# - golint - deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner
# - gomoddirectives - does not allow "replace" directives - too strict
# - goerr113 - following check is too strict: "do not define dynamic errors, use wrapped static errors instead",
# the check cannot be disabled
# - interfacer - deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner
# - maligned - deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner
# - nlreturn - leads to using too many line breaks
# - paralleltest - premature optimization
# - prealloc - considered a premature optimization.
# - scopelint - deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner
# - thelper - enforcing t.Helper() everywhere is too strict
# - wrapcheck - valuable linter, TODO: ignore false-positives (interfaces, internal imports) and adjust the code to comply
# - wsl - leads to using too many line breaks
linters:
enable:
- asciicheck
- bodyclose
- deadcode
- depguard
- dogsled
- dupl
- durationcheck
- errcheck
- errorlint
- exhaustive
- exportloopref
- forbidigo
- forcetypeassert
- gci
- gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- gocritic
- gocyclo
- godot
- gofmt
- gofumpt
- goheader
- goimports
- gomnd
- gomodguard
- goprintffuncname
- gosec
- gosimple
- govet
- ifshort
- importas
- ineffassign
- lll
- makezero
- misspell
- nakedret
- nestif
- nilerr
- noctx
- nolintlint
- predeclared
- revive
- rowserrcheck
- sqlclosecheck
- staticcheck
- structcheck
- stylecheck
- testpackage
- tparallel
- typecheck
- unconvert
- unparam
- unused
- varcheck
- wastedassign
- whitespace
linters-settings:
errcheck:
check-type-assertions: true
check-blank: true
errorlint:
# Check whether fmt.Errorf uses the %w verb for formatting errors - too strict
errorf: false
gocyclo:
min-complexity: 10
govet:
disable:
# Reordering struct fields may decrease readability
- fieldalignment
enable-all: true
lll:
# TODO: 120 (default) should be achieved to increase comfort of window split view
line-length: 127
nakedret:
max-func-lines: 5