Skip to content

Commit 866f7cb

Browse files
committed
Update .golangci.yaml to version 2
Signed-off-by: Smyslov Maxim <maksim.smyslov@flant.com>
1 parent 5693901 commit 866f7cb

1 file changed

Lines changed: 88 additions & 53 deletions

File tree

.golangci.yaml

Lines changed: 88 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,43 @@
1+
version: "2"
12
run:
2-
timeout: 10m
3+
timeout: 15m
34

4-
issues:
5-
exclude:
6-
- ST1005.*
7-
- "should not use dot imports"
8-
- "don't use an underscore in package name"
9-
- "exported: .*"
10-
exclude-dirs:
11-
# this code has been copied from kubectl cli. No need to lint external code.
12-
- go_lib/dependency/k8s/drain
13-
# this code has been copied from kubernetes vertical-pod-autoscaler. No need to lint external code.
14-
- modules/302-vertical-pod-autoscaler/hooks/internal/vertical-pod-autoscaler/v1
15-
16-
linters-settings:
17-
gci:
18-
sections:
19-
- standard
20-
- default
21-
- prefix(github.com/deckhouse/)
22-
goimports:
23-
local-prefixes: github.com/deckhouse/
24-
staticcheck:
25-
checks: ["all"]
26-
errcheck:
27-
# Is Depricateed, use exclude-functions: https://github.com/kisielk/errcheck#excluding-functions
28-
exclude-functions:
29-
- fmt:.*[rR]ead|[wW]rite|[cC]lose
30-
- io:Copy
31-
sloglint:
32-
# Enforce not mixing key-value pairs and attributes.
5+
linters:
6+
default: none
7+
enable:
8+
- asciicheck
9+
- bodyclose
10+
- copyloopvar
11+
# - depguard
12+
- dogsled
13+
- durationcheck
14+
- errcheck
15+
- gochecknoinits
16+
- gocritic
17+
- goprintffuncname
18+
- govet
19+
- ineffassign
20+
- misspell
21+
- musttag
22+
- nolintlint
23+
- nonamedreturns
24+
- prealloc
25+
- revive
26+
- sloglint
27+
- staticcheck
28+
- unconvert
29+
- unparam
30+
- unused
31+
- usestdlibvars
32+
- whitespace
33+
settings:
34+
errcheck:
35+
exclude-functions:
36+
- fmt:.*[rR]ead|[wW]rite|[cC]lose
37+
- io:Copy
38+
nonamedreturns:
39+
report-error-in-defer: false
40+
sloglint:
3341
no-mixed-args: true
3442
# Enforce using key-value pairs only (overrides no-mixed-args, incompatible with attr-only).
3543
kv-only: false
@@ -44,7 +52,7 @@ linters-settings:
4452
# Enforce using constants instead of raw keys.
4553
no-raw-keys: false
4654
# Enforce a single key naming convention.
47-
key-naming-case: ""
55+
# key-naming-case: ""
4856
# Enforce not using specific keys.
4957
forbidden-keys:
5058
- level
@@ -55,26 +63,53 @@ linters-settings:
5563
- time
5664
# Enforce putting arguments on separate lines.
5765
args-on-sep-lines: false
58-
59-
linters:
60-
disable-all: true
66+
staticcheck:
67+
checks:
68+
- all
69+
- '-QF1008' # not need to fix; we understand how to call nested structs
70+
exclusions:
71+
generated: lax
72+
presets:
73+
- comments
74+
- common-false-positives
75+
- legacy
76+
- std-error-handling
77+
rules:
78+
- path: (.+)\.go$
79+
text: ST1005.*
80+
- path: (.+)\.go$
81+
text: should not use dot imports
82+
- path: (.+)\.go$
83+
text: don't use an underscore in package name
84+
- path: (.+)\.go$
85+
text: 'exported: .*'
86+
paths:
87+
- go_lib/dependency/k8s/drain
88+
- modules/302-vertical-pod-autoscaler/hooks/internal/vertical-pod-autoscaler/v1
89+
- third_party$
90+
- builtin$
91+
- examples$
92+
formatters:
6193
enable:
62-
- dogsled
63-
- errcheck
64-
- gci
65-
- gocritic
66-
- gofmt
67-
- goimports
68-
- gosimple
69-
- govet
70-
- ineffassign
71-
- misspell
72-
- revive
73-
- sloglint
74-
- staticcheck
75-
# - structcheck
76-
- typecheck
77-
- unconvert
78-
- unparam
79-
- whitespace
80-
- copyloopvar
94+
- gci
95+
- gofmt
96+
- goimports
97+
settings:
98+
gci:
99+
sections:
100+
- standard
101+
- default
102+
- prefix(github.com/deckhouse/)
103+
- prefix(github.com/deckhouse/module-sdk)
104+
- localmodule
105+
goimports:
106+
local-prefixes:
107+
- github.com/deckhouse/
108+
exclusions:
109+
generated: lax
110+
paths:
111+
- go_lib/dependency/k8s/drain
112+
- modules/302-vertical-pod-autoscaler/hooks/internal/vertical-pod-autoscaler/v1
113+
- third_party$
114+
- builtin$
115+
- examples$

0 commit comments

Comments
 (0)