Skip to content

Commit 9cb8855

Browse files
committed
chore: Update .golangci.yml
Update golangci-lint configuration for version 2
1 parent 1dbb6ca commit 9cb8855

File tree

2 files changed

+91
-72
lines changed

2 files changed

+91
-72
lines changed

.golangci.yml

+90-71
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,12 @@
11
# golangci configuration
22
# Taken from https://github.com/kubevirt/kubevirt/blob/main/.golangci.yml
33

4-
linters-settings:
5-
dupl:
6-
threshold: 100
7-
funlen:
8-
lines: 100
9-
statements: 50
10-
goconst:
11-
min-len: 2
12-
min-occurrences: 3
13-
gocritic:
14-
enabled-tags:
15-
- diagnostic
16-
- experimental
17-
- opinionated
18-
- performance
19-
- style
20-
disabled-checks:
21-
- dupImport # https://github.com/go-critic/go-critic/issues/845
22-
- ifElseChain
23-
- octalLiteral
24-
- paramTypeCombine
25-
- whyNoLint
26-
- wrapperFunc
27-
settings:
28-
hugeParam:
29-
sizeThreshold: 1024
30-
rangeValCopy:
31-
sizeThreshold: 1024
32-
gocyclo:
33-
min-complexity: 15
34-
goimports:
35-
local-prefixes: github.com/0xfelix/cga-led
36-
mnd:
37-
# don't include the "operation" and "assign"
38-
checks: argument,case,condition,return
39-
ignored-functions:
40-
- '^Eventually$'
41-
- '^EventuallyWithOffset$'
42-
- '^ExpectWithOffset$'
43-
- '^console\.ExpectBatch$'
44-
- '^console\.RunCommand$'
45-
govet:
46-
enable:
47-
- shadow
48-
lll:
49-
line-length: 140
50-
maligned:
51-
suggest-new: true
52-
misspell:
53-
locale: US
54-
nolintlint:
55-
allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space)
56-
allow-unused: false # report any unused nolint directives
57-
require-explanation: false # don't require an explanation for nolint directives
58-
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
59-
stylecheck:
60-
dot-import-whitelist:
61-
- "github.com/onsi/ginkgo/v2"
62-
- "github.com/onsi/gomega"
63-
gofumpt:
64-
extra-rules: true
65-
4+
version: "2"
665
linters:
67-
disable-all: true
6+
default: none
687
enable:
698
- bodyclose
9+
- copyloopvar
7010
- dogsled
7111
- dupl
7212
- errcheck
@@ -76,29 +16,22 @@ linters:
7616
- goconst
7717
- gocritic
7818
- gocyclo
79-
- gofmt
80-
- gofumpt
8119
- goheader
82-
- goimports
83-
- mnd
8420
- goprintffuncname
8521
- gosec
86-
- gosimple
8722
- govet
8823
- ineffassign
8924
- lll
9025
- misspell
26+
- mnd
9127
- nakedret
9228
- noctx
9329
- nolintlint
9430
- rowserrcheck
9531
- staticcheck
96-
- stylecheck
97-
- typecheck
9832
- unconvert
9933
- unused
10034
- whitespace
101-
10235
# don't enable:
10336
# - asciicheck
10437
# - scopelint
@@ -114,3 +47,89 @@ linters:
11447
# - testpackage
11548
# - revive
11649
# - wsl
50+
settings:
51+
dupl:
52+
threshold: 100
53+
funlen:
54+
lines: 100
55+
statements: 50
56+
goconst:
57+
min-len: 2
58+
min-occurrences: 2
59+
gocritic:
60+
disabled-checks:
61+
- dupImport # https://github.com/go-critic/go-critic/issues/845
62+
- ifElseChain
63+
- octalLiteral
64+
- paramTypeCombine
65+
- whyNoLint
66+
- wrapperFunc
67+
enabled-tags:
68+
- diagnostic
69+
- experimental
70+
- opinionated
71+
- performance
72+
- style
73+
settings:
74+
hugeParam:
75+
sizeThreshold: 1024
76+
rangeValCopy:
77+
sizeThreshold: 1024
78+
gocyclo:
79+
min-complexity: 15
80+
govet:
81+
enable:
82+
- shadow
83+
lll:
84+
line-length: 140
85+
misspell:
86+
locale: US
87+
mnd:
88+
# don't include the "operation" and "assign"
89+
checks:
90+
- argument
91+
- case
92+
- condition
93+
- return
94+
ignored-functions:
95+
- ^Eventually$
96+
- ^EventuallyWithOffset$
97+
- ^ExpectWithOffset$
98+
- ^console\.ExpectBatch$
99+
- ^console\.RunCommand$
100+
nolintlint:
101+
require-explanation: false # don't require an explanation for nolint directives
102+
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
103+
allow-unused: false # report any unused nolint directives
104+
staticcheck:
105+
dot-import-whitelist:
106+
- github.com/onsi/ginkgo/v2
107+
- github.com/onsi/gomega
108+
exclusions:
109+
generated: lax
110+
presets:
111+
- comments
112+
- common-false-positives
113+
- legacy
114+
- std-error-handling
115+
paths:
116+
- third_party$
117+
- builtin$
118+
- examples$
119+
formatters:
120+
enable:
121+
- gofmt
122+
- gofumpt
123+
- goimports
124+
settings:
125+
gofumpt:
126+
extra-rules: true
127+
goimports:
128+
local-prefixes:
129+
- github.com/0xfelix/cga-led
130+
exclusions:
131+
generated: lax
132+
paths:
133+
- third_party$
134+
- builtin$
135+
- examples$

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module cga-led
1+
module github.com/0xfelix/cga-led
22

33
go 1.24

0 commit comments

Comments
 (0)