-
Notifications
You must be signed in to change notification settings - Fork 282
Expand file tree
/
Copy path.golangci.yml
More file actions
155 lines (155 loc) · 3.74 KB
/
Copy path.golangci.yml
File metadata and controls
155 lines (155 loc) · 3.74 KB
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
144
145
146
147
148
149
150
151
152
153
154
155
version: "2"
run:
go: "1.26"
build-tags:
- goexperiment.jsonv2
linters:
default: none
enable:
- bodyclose
- contextcheck
- depguard
- errorlint
- gocritic
- gocyclo
- gomodguard_v2
- gosec
- govet
- ineffassign
- misspell
- nolintlint
- perfsprint
- revive
- staticcheck
- testifylint
- unconvert
- unused
- usestdlibvars
- usetesting
settings:
depguard:
rules:
main:
list-mode: lax
deny:
- pkg: golang.org/x/exp/slices
desc: Use 'slices' instead
- pkg: golang.org/x/exp/maps
desc: Use 'maps' or 'github.com/samber/lo' instead
dupl:
threshold: 100
errcheck:
check-type-assertions: true
check-blank: true
gocritic:
disabled-checks:
- appendAssign
- commentedOutCode
- hugeParam
- rangeValCopy
- unnamedResult
- whyNoLint
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
settings:
ruleguard:
failOn: all
rules: ${base-path}/misc/lint/rules.go
gocyclo:
min-complexity: 40
gomodguard_v2:
blocked:
- module: github.com/hashicorp/go-version
recommendations:
- github.com/aquasecurity/go-version
reason: "`aquasecurity/go-version` is designed for our use-cases"
- module: github.com/Masterminds/semver
recommendations:
- github.com/aquasecurity/go-version
reason: "`aquasecurity/go-version` is designed for our use-cases"
gosec:
excludes:
- G101
- G114
- G115
- G204
- G304
- G402
misspell:
locale: US
ignore-rules:
- behaviour
- licence
- optimise
- simmilar
nolintlint:
# Enable to require nolint directives to mention the specific linter being suppressed.
require-specific: true
perfsprint:
int-conversion: false
err-error: true
errorf: true
sprintf1: false
strconcat: false
revive:
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md
rules:
- name: context-as-argument
arguments:
- allow-types-before: "*testing.T"
- name: context-keys-type
- name: duplicated-imports
- name: early-return
arguments:
- "preserve-scope"
- name: if-return
- name: indent-error-flow
arguments:
- "preserve-scope"
- name: superfluous-else
arguments:
- "preserve-scope"
- name: unused-parameter
arguments:
- allow-regex: "^_"
- name: use-any
- name: use-errors-new
- name: useless-break
- name: var-declaration
staticcheck:
checks:
- all
- -QF1008 # Omit embedded fields from selector expression
- -ST1000 # Incorrect or missing package comment
- -ST1001 # Dot imports are discouraged
- -ST1003 # Poorly chosen identifier
- -ST1020 # The documentation of an exported function should start with the function’s name
- -ST1021 # The documentation of an exported type should start with type’s name
testifylint:
enable-all: true
exclusions:
warn-unused: true
issues:
max-issues-per-linter: 0
max-same-issues: 0
formatters:
enable:
- gci
- gofmt
settings:
gci:
sections:
- standard
- default
- prefix(github.com/aquasecurity/)
- blank
- dot
gofmt:
simplify: false
rewrite-rules:
- pattern: interface{}
replacement: any