You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
local-prefixes: go.etcd.io # Put imports beginning with prefix after 3rd-party packages.
53
-
nakedret:
54
-
# Align with https://github.com/alexkohler/nakedret/blob/v1.0.2/cmd/nakedret/main.go#L10
55
-
max-func-lines: 5
56
-
revive:
57
-
confidence: 0.8
19
+
settings:
20
+
nakedret:
21
+
# Align with https://github.com/alexkohler/nakedret/blob/v1.0.2/cmd/nakedret/main.go#L10
22
+
max-func-lines: 5
23
+
revive:
24
+
confidence: 0.8
25
+
rules:
26
+
- name: blank-imports
27
+
- name: context-as-argument
28
+
- name: context-keys-type
29
+
- name: dot-imports
30
+
- name: early-return
31
+
arguments:
32
+
- preserveScope
33
+
- name: error-return
34
+
- name: error-naming
35
+
- name: error-strings
36
+
- name: errorf
37
+
- name: if-return
38
+
- name: increment-decrement
39
+
- name: indent-error-flow
40
+
- name: package-comments
41
+
- name: range
42
+
- name: receiver-naming
43
+
- name: superfluous-else
44
+
arguments:
45
+
- preserveScope
46
+
- name: time-naming
47
+
- name: unnecessary-stmt
48
+
- name: use-any
49
+
- name: var-declaration
50
+
- name: var-naming
51
+
arguments:
52
+
# The following is the configuration for var-naming rule, the first element is the allow list and the second element is the deny list.
53
+
- [] # AllowList: leave it empty to use the default (empty, too). This means that we're not relaxing the rule in any way, i.e. elementId will raise a violation, it should be elementID, refer to the next line to see the list of denied initialisms.
54
+
# DenyList: Add GRPC and WAL to strict the rule not allowing instances like Wal or Grpc. The default values are located at commonInitialisms, refer to: https://github.com/mgechev/revive/blob/v1.3.7/lint/utils.go#L93-L133.
55
+
- - GRPC
56
+
- WAL
57
+
- name: exported
58
+
disabled: true
59
+
- name: unexported-return
60
+
disabled: true
61
+
staticcheck:
62
+
checks:
63
+
- all
64
+
- -SA1019 # TODO(fix) Using a deprecated function, variable, constant or field
65
+
- -SA2002 # TODO(fix) Called testing.T.FailNow or SkipNow in a goroutine, which isn’t allowed
66
+
- -QF1001 # TODO(fix) Apply De Morgan’s law
67
+
- -QF1002 # TODO(fix) Convert untagged switch to tagged switch
68
+
- -QF1003 # TODO(fix) Convert if/else-if chain to tagged switch
69
+
- -QF1004 # TODO(fix) Use strings.ReplaceAll instead of strings.Replace with n == -1
70
+
- -QF1006 # TODO(fix) Lift if+break into loop condition
71
+
- -QF1008 # TODO(fix) Omit embedded fields from selector expression
72
+
- -QF1009 # TODO(fix) Use time.Time.Equal instead of == operator
73
+
- -QF1012 # TODO(fix) Use fmt.Fprintf(x, ...) instead of x.Write(fmt.Sprintf(...))
74
+
- -ST1003 # TODO(fix) Poorly chosen identifier
75
+
- -ST1005 # TODO(fix) Drop unnecessary use of the blank identifier
76
+
- ST1019 # Importing the same package multiple times.
77
+
testifylint:
78
+
enable-all: true
79
+
formatter:
80
+
# Require f-assertions (e.g. assert.Equalf) if a message is passed to the assertion, even if
81
+
# there is no variable-length variables, i.e. require require.NoErrorf for both cases below:
# Note from golang programming perspective, we still prefer non-f-functions (i.e. fmt.Print)
86
+
# to f-functions (i.e. fmt.Printf) when there is no variable-length parameters. It's accepted
87
+
# to always require f-functions for stretchr/testify, but not for golang standard lib.
88
+
# Also refer to https://github.com/etcd-io/etcd/pull/18741#issuecomment-2422395914
89
+
require-f-funcs: true
90
+
thelper:
91
+
test:
92
+
first: false
93
+
begin: false
94
+
fuzz:
95
+
first: false
96
+
begin: false
97
+
benchmark:
98
+
first: false
99
+
begin: false
100
+
tb:
101
+
first: false
102
+
begin: false
103
+
usetesting:
104
+
os-mkdir-temp: false
105
+
exclusions:
106
+
generated: lax
107
+
presets:
108
+
- comments
109
+
- common-false-positives
110
+
- legacy
111
+
- std-error-handling
58
112
rules:
59
-
- name: blank-imports
60
-
- name: context-as-argument
61
-
- name: context-keys-type
62
-
- name: dot-imports
63
-
- name: early-return
64
-
arguments:
65
-
- "preserveScope"
66
-
- name: error-return
67
-
- name: error-naming
68
-
- name: error-strings
69
-
- name: errorf
70
-
- name: if-return
71
-
- name: increment-decrement
72
-
- name: indent-error-flow
73
-
- name: package-comments
74
-
- name: range
75
-
- name: receiver-naming
76
-
- name: superfluous-else
77
-
arguments:
78
-
- "preserveScope"
79
-
- name: time-naming
80
-
- name: unnecessary-stmt
81
-
- name: use-any
82
-
- name: var-declaration
83
-
- name: var-naming
84
-
arguments:
85
-
# The following is the configuration for var-naming rule, the first element is the allow list and the second element is the deny list.
86
-
- [] # AllowList: leave it empty to use the default (empty, too). This means that we're not relaxing the rule in any way, i.e. elementId will raise a violation, it should be elementID, refer to the next line to see the list of denied initialisms.
87
-
- ["GRPC", "WAL"] # DenyList: Add GRPC and WAL to strict the rule not allowing instances like Wal or Grpc. The default values are located at commonInitialisms, refer to: https://github.com/mgechev/revive/blob/v1.3.7/lint/utils.go#L93-L133.
88
-
# TODO: enable the following rules
89
-
- name: exported
90
-
disabled: true
91
-
- name: unexported-return
92
-
disabled: true
93
-
staticcheck:
94
-
checks:
95
-
- all
96
-
- -SA1019 # TODO(fix) Using a deprecated function, variable, constant or field
97
-
- -SA2002 # TODO(fix) Called testing.T.FailNow or SkipNow in a goroutine, which isn’t allowed
98
-
stylecheck:
99
-
checks:
100
-
- ST1019 # Importing the same package multiple times.
101
-
testifylint:
102
-
enable-all: true
103
-
formatter:
104
-
# Require f-assertions (e.g. assert.Equalf) if a message is passed to the assertion, even if
105
-
# there is no variable-length variables, i.e. require require.NoErrorf for both cases below:
0 commit comments