Skip to content

Commit 50506b7

Browse files
committed
fix: disable problematic linter errors
Signed-off-by: Christian Stewart <christian@aperture.us>
1 parent b6f052c commit 50506b7

File tree

5 files changed

+253
-254
lines changed

5 files changed

+253
-254
lines changed

.golangci.yml

Lines changed: 76 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,94 @@
1+
# Config file version V2 has been introduced, read more in lintersdb.
2+
# Visit https://golangci-lint.run/usage/configuration/#config-file
3+
version: "2"
4+
5+
# Settings for the `run` command.
6+
run:
7+
# Concurrency defines how many analyses can run simultaneously.
8+
# Default is 1.
9+
concurrency: 4
10+
# Modules-download-mode specifies how to download modules.
11+
# Allowed values: readonly, vendor, mod. Default is readonly.
12+
modules-download-mode: vendor
13+
14+
# Linters configuration.
115
linters:
216
enable:
317
- depguard
4-
- goimports
518
- gosec
6-
- gosimple
7-
- govet
819
- importas
9-
# - ineffassign
1020
- misspell
1121
- revive
12-
- staticcheck
13-
- typecheck
1422
# - unconvert
15-
- unused
16-
1723
disable:
1824
- errcheck
25+
settings:
26+
depguard:
27+
rules:
28+
main:
29+
deny:
30+
- pkg: io/ioutil
31+
desc: The io/ioutil package has been deprecated, see https://go.dev/doc/go1.16#ioutil
32+
- pkg: "github.com/stretchr/testify/assert"
33+
desc: Use "gotest.tools/v3/assert" instead
34+
- pkg: "github.com/stretchr/testify/require"
35+
desc: Use "gotest.tools/v3/assert" instead
36+
- pkg: "github.com/stretchr/testify/suite"
37+
desc: Do not use
38+
gosec:
39+
excludes:
40+
- G306 # Allow WriteFile permissions to be 0644.
41+
importas:
42+
# Do not allow unaliased imports of aliased packages.
43+
no-unaliased: true
44+
revive:
45+
rules:
46+
- name: package-comments
47+
disabled: true
48+
staticcheck:
49+
# All SA checks are enabled by default, customize as needed.
50+
# Refer to https://staticcheck.io/docs/checks for check details.
51+
checks:
52+
- all
53+
- '-SA1012'
54+
- '-ST1003'
55+
- '-ST1023'
56+
- '-QF1011'
57+
- '-QF1003'
58+
- '-QF1001'
1959

20-
run:
21-
concurrency: 4
22-
modules-download-mode: vendor
23-
24-
skip-dirs:
25-
- hack
26-
27-
linters-settings:
28-
staticcheck:
29-
checks:
30-
- all
31-
- '-SA1012' # Allow passing nil contexts.
32-
33-
importas:
34-
# Do not allow unaliased imports of aliased packages.
35-
no-unaliased: true
36-
37-
maligned:
38-
suggest-new: true
39-
40-
depguard:
41-
rules:
42-
main:
43-
deny:
44-
- pkg: io/ioutil
45-
desc: The io/ioutil package has been deprecated, see https://go.dev/doc/go1.16#ioutil
46-
- pkg: "github.com/stretchr/testify/assert"
47-
desc: Use "gotest.tools/v3/assert" instead
48-
- pkg: "github.com/stretchr/testify/require"
49-
desc: Use "gotest.tools/v3/assert" instead
50-
- pkg: "github.com/stretchr/testify/suite"
51-
desc: Do not use
52-
53-
revive:
54-
rules:
55-
- name: package-comments
56-
disabled: true
60+
# Exclusions based on common patterns and presets.
61+
exclusions:
62+
# Treat generated files leniently.
63+
generated: lax
64+
# Use predefined sets of common exclusions.
65+
presets:
66+
- comments
67+
- common-false-positives
68+
- legacy # Excludes checks deprecated in new Go versions
69+
- std-error-handling # Excludes some common stdlib error patterns
70+
# Exclude specific paths using regex.
71+
paths:
72+
- third_party$
73+
- builtin$
74+
- examples$
5775

76+
# Issues reporting configuration.
5877
issues:
5978
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
6079
max-issues-per-linter: 0
61-
6280
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
6381
max-same-issues: 0
6482

65-
exclude:
66-
- G601
83+
# Formatters configuration (new in V2).
84+
formatters:
85+
enable:
86+
- goimports # Enable goimports as a formatter.
87+
exclusions:
88+
# Treat generated files leniently for formatting.
89+
generated: lax
90+
# Exclude specific paths from formatting using regex.
91+
paths:
92+
- third_party$
93+
- builtin$
94+
- examples$

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ $(GOLANGCI_LINT):
2929
cd ./hack; \
3030
go build -v \
3131
-o ./bin/golangci-lint \
32-
github.com/golangci/golangci-lint/cmd/golangci-lint
32+
github.com/golangci/golangci-lint/v2/cmd/golangci-lint
3333

3434
.PHONY: build
3535
build: vendor

hack/go.mod

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,36 @@ require (
1515
require (
1616
4d63.com/gocheckcompilerdirectives v1.3.0 // indirect
1717
4d63.com/gochecknoglobals v0.2.2 // indirect
18+
codeberg.org/chavacava/garif v0.2.0 // indirect
19+
dev.gaijin.team/go/exhaustruct/v4 v4.0.0 // indirect
20+
dev.gaijin.team/go/golib v0.6.0 // indirect
1821
github.com/4meepo/tagalign v1.4.3 // indirect
1922
github.com/Abirdcfly/dupword v0.1.6 // indirect
23+
github.com/AdminBenni/iota-mixing v1.0.0 // indirect
24+
github.com/AlwxSin/noinlineerr v1.0.5 // indirect
2025
github.com/Antonboom/errname v1.1.1 // indirect
2126
github.com/Antonboom/nilnil v1.1.1 // indirect
2227
github.com/Antonboom/testifylint v1.6.4 // indirect
2328
github.com/BurntSushi/toml v1.5.0 // indirect
24-
github.com/Crocmagnon/fatcontext v0.7.1 // indirect
2529
github.com/Djarvur/go-err113 v0.1.1 // indirect
26-
github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.1 // indirect
2730
github.com/Masterminds/semver/v3 v3.3.1 // indirect
31+
github.com/MirrexOne/unqueryvet v1.2.1 // indirect
2832
github.com/OpenPeeDeeP/depguard/v2 v2.2.1 // indirect
33+
github.com/alecthomas/chroma/v2 v2.20.0 // indirect
2934
github.com/alecthomas/go-check-sumtype v0.3.1 // indirect
3035
github.com/alexkohler/nakedret/v2 v2.0.6 // indirect
3136
github.com/alexkohler/prealloc v1.0.0 // indirect
37+
github.com/alfatraining/structtag v1.0.0 // indirect
3238
github.com/alingse/asasalint v0.0.11 // indirect
3339
github.com/alingse/nilnesserr v0.2.0 // indirect
34-
github.com/ashanbrown/forbidigo v1.6.0 // indirect
35-
github.com/ashanbrown/makezero v1.2.0 // indirect
40+
github.com/ashanbrown/forbidigo/v2 v2.1.0 // indirect
41+
github.com/ashanbrown/makezero/v2 v2.0.1 // indirect
42+
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
3643
github.com/beorn7/perks v1.0.1 // indirect
3744
github.com/bkielbasa/cyclop v1.2.3 // indirect
3845
github.com/blizzy78/varnamelen v0.8.0 // indirect
3946
github.com/bombsimon/wsl/v4 v4.7.0 // indirect
47+
github.com/bombsimon/wsl/v5 v5.2.0 // indirect
4048
github.com/breml/bidichk v0.3.3 // indirect
4149
github.com/breml/errchkjson v0.4.1 // indirect
4250
github.com/butuzov/ireturn v0.4.0 // indirect
@@ -45,12 +53,18 @@ require (
4553
github.com/ccojocar/zxcvbn-go v1.0.4 // indirect
4654
github.com/cespare/xxhash/v2 v2.3.0 // indirect
4755
github.com/charithe/durationcheck v0.0.10 // indirect
48-
github.com/chavacava/garif v0.1.0 // indirect
56+
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect
57+
github.com/charmbracelet/lipgloss v1.1.0 // indirect
58+
github.com/charmbracelet/x/ansi v0.8.0 // indirect
59+
github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd // indirect
60+
github.com/charmbracelet/x/term v0.2.1 // indirect
4961
github.com/ckaznocha/intrange v0.3.1 // indirect
5062
github.com/curioswitch/go-reassign v0.3.0 // indirect
5163
github.com/daixiang0/gci v0.13.7 // indirect
64+
github.com/dave/dst v0.27.3 // indirect
5265
github.com/davecgh/go-spew v1.1.1 // indirect
5366
github.com/denis-tingaikin/go-header v0.5.0 // indirect
67+
github.com/dlclark/regexp2 v1.11.5 // indirect
5468
github.com/ettle/strcase v0.2.0 // indirect
5569
github.com/fatih/color v1.18.0 // indirect
5670
github.com/fatih/structtag v1.2.0 // indirect
@@ -69,21 +83,25 @@ require (
6983
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
7084
github.com/go-xmlfmt/xmlfmt v1.1.3 // indirect
7185
github.com/gobwas/glob v0.2.3 // indirect
86+
github.com/godoc-lint/godoc-lint v0.10.0 // indirect
7287
github.com/gofrs/flock v0.12.1 // indirect
7388
github.com/golang/protobuf v1.5.3 // indirect
89+
github.com/golangci/asciicheck v0.5.0 // indirect
7490
github.com/golangci/dupl v0.0.0-20250308024227-f665c8d69b32 // indirect
7591
github.com/golangci/go-printf-func-name v0.1.1 // indirect
7692
github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d // indirect
93+
github.com/golangci/golines v0.0.0-20250217134842-442fd0091d95 // indirect
7794
github.com/golangci/misspell v0.7.0 // indirect
95+
github.com/golangci/nilerr v0.0.0-20250918000102-015671e622fe // indirect
7896
github.com/golangci/plugin-module-register v0.1.2 // indirect
7997
github.com/golangci/revgrep v0.8.0 // indirect
98+
github.com/golangci/swaggoswag v0.0.0-20250504205917-77f2aca3143e // indirect
8099
github.com/golangci/unconvert v0.0.0-20250410112200-a129a6e6413e // indirect
81100
github.com/google/go-cmp v0.7.0 // indirect
82101
github.com/gordonklaus/ineffassign v0.2.0 // indirect
83102
github.com/gostaticanalysis/analysisutil v0.7.1 // indirect
84103
github.com/gostaticanalysis/comment v1.5.0 // indirect
85104
github.com/gostaticanalysis/forcetypeassert v0.2.0 // indirect
86-
github.com/gostaticanalysis/nilerr v0.1.1 // indirect
87105
github.com/hashicorp/go-immutable-radix/v2 v2.1.0 // indirect
88106
github.com/hashicorp/go-version v1.7.0 // indirect
89107
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
@@ -106,8 +124,11 @@ require (
106124
github.com/ldez/tagliatelle v0.7.2 // indirect
107125
github.com/ldez/usetesting v0.5.0 // indirect
108126
github.com/leonklingele/grouper v1.1.2 // indirect
127+
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
109128
github.com/macabu/inamedparam v0.2.0 // indirect
110129
github.com/magiconair/properties v1.8.6 // indirect
130+
github.com/manuelarte/embeddedstructfieldcheck v0.4.0 // indirect
131+
github.com/manuelarte/funcorder v0.5.0 // indirect
111132
github.com/maratori/testableexamples v1.0.0 // indirect
112133
github.com/maratori/testpackage v1.1.1 // indirect
113134
github.com/matoous/godox v1.1.0 // indirect
@@ -119,11 +140,11 @@ require (
119140
github.com/mitchellh/go-homedir v1.1.0 // indirect
120141
github.com/mitchellh/mapstructure v1.5.0 // indirect
121142
github.com/moricho/tparallel v0.3.2 // indirect
143+
github.com/muesli/termenv v0.16.0 // indirect
122144
github.com/nakabonne/nestif v0.3.1 // indirect
123145
github.com/nishanths/exhaustive v0.12.0 // indirect
124146
github.com/nishanths/predeclared v0.2.2 // indirect
125147
github.com/nunnatsa/ginkgolinter v0.21.0 // indirect
126-
github.com/olekukonko/tablewriter v0.0.5 // indirect
127148
github.com/pelletier/go-toml v1.9.5 // indirect
128149
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
129150
github.com/pmezard/go-difflib v1.0.0 // indirect
@@ -149,7 +170,6 @@ require (
149170
github.com/securego/gosec/v2 v2.22.8 // indirect
150171
github.com/sirupsen/logrus v1.9.3 // indirect
151172
github.com/sivchari/containedctx v1.0.3 // indirect
152-
github.com/sivchari/tenv v1.12.1 // indirect
153173
github.com/sonatard/noctx v0.4.0 // indirect
154174
github.com/sourcegraph/go-diff v0.7.0 // indirect
155175
github.com/spf13/afero v1.14.0 // indirect
@@ -163,7 +183,6 @@ require (
163183
github.com/stretchr/objx v0.5.2 // indirect
164184
github.com/stretchr/testify v1.11.1 // indirect
165185
github.com/subosito/gotenv v1.4.1 // indirect
166-
github.com/tdakkota/asciicheck v0.4.1 // indirect
167186
github.com/tetafro/godot v1.5.4 // indirect
168187
github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67 // indirect
169188
github.com/timonwong/loggercheck v0.11.0 // indirect
@@ -174,13 +193,15 @@ require (
174193
github.com/uudashr/gocognit v1.2.0 // indirect
175194
github.com/uudashr/iface v1.4.1 // indirect
176195
github.com/xen0n/gosmopolitan v1.3.0 // indirect
196+
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
177197
github.com/yagipy/maintidx v1.0.0 // indirect
178198
github.com/yeya24/promlinter v0.3.0 // indirect
179199
github.com/ykadowak/zerologlint v0.1.5 // indirect
180200
gitlab.com/bosi/decorder v0.4.2 // indirect
181201
go-simpler.org/musttag v0.14.0 // indirect
182202
go-simpler.org/sloglint v0.11.1 // indirect
183-
go.uber.org/atomic v1.7.0 // indirect
203+
go.augendre.info/arangolint v0.2.0 // indirect
204+
go.augendre.info/fatcontext v0.8.1 // indirect
184205
go.uber.org/automaxprocs v1.6.0 // indirect
185206
go.uber.org/multierr v1.10.0 // indirect
186207
go.uber.org/zap v1.27.0 // indirect
@@ -190,8 +211,6 @@ require (
190211
golang.org/x/sys v0.37.0 // indirect
191212
golang.org/x/telemetry v0.0.0-20251008203120-078029d740a8 // indirect
192213
golang.org/x/text v0.29.0 // indirect
193-
golang.org/x/tools/go/expect v0.1.1-deprecated // indirect
194-
golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated // indirect
195214
google.golang.org/protobuf v1.36.6 // indirect
196215
gopkg.in/ini.v1 v1.67.0 // indirect
197216
gopkg.in/yaml.v2 v2.4.0 // indirect

0 commit comments

Comments
 (0)