-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.golangci.yaml
143 lines (143 loc) · 4.34 KB
/
.golangci.yaml
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
linters:
enable:
- revive
- sloglint
- godox
- gosec
- musttag
- nilnil
- goconst
- gocritic
- gofmt
- iface
- thelper
- tparallel
issues:
exclude-rules:
- path: (.+)_test.go
linters:
- revive
text: "^(enforce-slice-style|enforce-map-style)"
linters-settings:
revive:
# Default: false
ignore-generated-header: true
# Default: 0.8
confidence: 0.1
rules:
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#context-as-argument
- name: context-as-argument
severity: error
disabled: false
exclude: [ "" ]
arguments:
- allowTypesBefore: "*testing.T"
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#early-return
- name: early-return
severity: error
disabled: false
exclude: [ "" ]
arguments:
- "preserveScope"
- "allowJump"
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#enforce-map-style
- name: enforce-map-style
severity: error
disabled: false
exclude: [ "" ]
arguments:
- "make"
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#enforce-slice-style
- name: enforce-slice-style
severity: error
disabled: false
exclude: [ "" ]
arguments:
- "make"
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#filename-format
- name: filename-format
severity: error
disabled: false
exclude: [ "" ]
arguments:
- "^[_a-z][_a-z0-9]*.go$"
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#optimize-operands-order
- name: optimize-operands-order
severity: error
disabled: false
exclude: [ "" ]
sloglint:
# Enforce using attributes only (overrides no-mixed-args, incompatible with kv-only).
# https://github.com/go-simpler/sloglint?tab=readme-ov-file#attributes-only
# Default: false
attr-only: true
# Enforce using static values for log messages.
# https://github.com/go-simpler/sloglint?tab=readme-ov-file#static-messages
# Default: false
static-msg: true
# Enforce using constants instead of raw keys.
# https://github.com/go-simpler/sloglint?tab=readme-ov-file#no-raw-keys
# Default: false
no-raw-keys: true
# Enforce a single key naming convention.
# Values: snake, kebab, camel, pascal
# https://github.com/go-simpler/sloglint?tab=readme-ov-file#key-naming-convention
# Default: ""
key-naming-case: snake
# Enforce not using specific keys.
# https://github.com/go-simpler/sloglint?tab=readme-ov-file#forbidden-keys
# Default: []
forbidden-keys:
- time
- level
- msg
- source
- foo
# Enforce putting arguments on separate lines.
# https://github.com/go-simpler/sloglint?tab=readme-ov-file#arguments-on-separate-lines
# Default: false
args-on-sep-lines: true
goconst:
# Ignore test files.
# Default: false
ignore-tests: true
# Ignore when constant is not used as function argument.
# Default: true
ignore-calls: true
# Exclude strings matching the given regular expression.
# Default: ""
ignore-strings: ''
nilnil:
# In addition, detect opposite situation (simultaneous return of non-nil error and valid value).
# Default: false
detect-opposite: true
# List of return types to check.
# Default: ["chan", "func", "iface", "map", "ptr", "uintptr", "unsafeptr"]
checked-types:
- chan
- func
- iface
- map
- ptr
- uintptr
- unsafeptr
gocritic:
enable-all: true
gofmt:
# Simplify code: gofmt with `-s` option.
# Default: true
simplify: false
# Apply the rewrite rules to the source before reformatting.
# https://pkg.go.dev/cmd/gofmt
# Default: []
rewrite-rules:
- pattern: 'interface{}'
replacement: 'any'
- pattern: 'a[b:len(a)]'
replacement: 'a[b:]'
iface:
# List of analyzers.
# Default: ["identical"]
enable:
- identical # Identifies interfaces in the same package that have identical method sets.
- unused # Identifies interfaces that are not used anywhere in the same package where the interface is defined.