Skip to content

Commit e5703de

Browse files
committed
feat: deprecation step 2
1 parent beb8721 commit e5703de

File tree

10 files changed

+4
-115
lines changed

10 files changed

+4
-115
lines changed

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ require (
6969
github.com/ldez/gomoddirectives v0.2.4
7070
github.com/ldez/tagliatelle v0.5.0
7171
github.com/leonklingele/grouper v1.1.2
72-
github.com/lufeee/execinquery v1.2.1
7372
github.com/macabu/inamedparam v0.1.3
7473
github.com/maratori/testableexamples v1.0.0
7574
github.com/maratori/testpackage v1.1.1

go.sum

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jsonschema/golangci.next.jsonschema.json

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@
317317
"contextcheck",
318318
"copyloopvar",
319319
"cyclop",
320-
"deadcode",
321320
"decorder",
322321
"depguard",
323322
"dogsled",
@@ -328,9 +327,7 @@
328327
"errchkjson",
329328
"errname",
330329
"errorlint",
331-
"execinquery",
332330
"exhaustive",
333-
"exhaustivestruct",
334331
"exhaustruct",
335332
"exportloopref",
336333
"fatcontext",
@@ -354,7 +351,6 @@
354351
"gofumpt",
355352
"goheader",
356353
"goimports",
357-
"golint",
358354
"gomoddirectives",
359355
"gomodguard",
360356
"goprintffuncname",
@@ -364,19 +360,16 @@
364360
"govet",
365361
"grouper",
366362
"iface",
367-
"ifshort",
368363
"importas",
369364
"inamedparam",
370365
"ineffassign",
371366
"interfacebloat",
372-
"interfacer",
373367
"intrange",
374368
"ireturn",
375369
"lll",
376370
"loggercheck",
377371
"maintidx",
378372
"makezero",
379-
"maligned",
380373
"mirror",
381374
"misspell",
382375
"mnd",
@@ -389,7 +382,6 @@
389382
"noctx",
390383
"nolintlint",
391384
"nonamedreturns",
392-
"nosnakecase",
393385
"nosprintfhostport",
394386
"paralleltest",
395387
"perfsprint",
@@ -401,11 +393,9 @@
401393
"recvcheck",
402394
"revive",
403395
"rowserrcheck",
404-
"scopelint",
405396
"sloglint",
406397
"sqlclosecheck",
407398
"staticcheck",
408-
"structcheck",
409399
"stylecheck",
410400
"tagalign",
411401
"tagliatelle",
@@ -419,7 +409,6 @@
419409
"unparam",
420410
"unused",
421411
"usestdlibvars",
422-
"varcheck",
423412
"varnamelen",
424413
"wastedassign",
425414
"whitespace",

pkg/config/linters_settings.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ type LintersSettings struct {
229229
Gofumpt GofumptSettings
230230
Goheader GoHeaderSettings
231231
Goimports GoImportsSettings
232-
Gomnd GoMndSettings
233232
GoModDirectives GoModDirectivesSettings
234233
Gomodguard GoModGuardSettings
235234
Gosec GoSecSettings
@@ -569,14 +568,6 @@ type GoImportsSettings struct {
569568
LocalPrefixes string `mapstructure:"local-prefixes"`
570569
}
571570

572-
// Deprecated: use MndSettings.
573-
type GoMndSettings struct {
574-
MndSettings `mapstructure:",squash"`
575-
576-
// Deprecated: use root level settings instead.
577-
Settings map[string]map[string]any
578-
}
579-
580571
type GoModDirectivesSettings struct {
581572
ReplaceAllowList []string `mapstructure:"replace-allow-list"`
582573
ReplaceLocal bool `mapstructure:"replace-local"`

pkg/config/loader.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -413,12 +413,6 @@ func (l *Loader) handleLinterOptionDeprecations() {
413413
l.log.Warnf("The configuration option `linters.godot.check-all` is deprecated, please use `linters.godot.scope: all`.")
414414
}
415415

416-
// Deprecated since v1.44.0.
417-
if len(l.cfg.LintersSettings.Gomnd.Settings) > 0 {
418-
l.log.Warnf("The configuration option `linters.gomnd.settings` is deprecated. Please use the options " +
419-
"`linters.gomnd.checks`,`linters.gomnd.ignored-numbers`,`linters.gomnd.ignored-files`,`linters.gomnd.ignored-functions`.")
420-
}
421-
422416
// Deprecated since v1.47.0
423417
if l.cfg.LintersSettings.Gofumpt.LangVersion != "" {
424418
l.log.Warnf("The configuration option `linters.gofumpt.lang-version` is deprecated, please use global `run.go`.")

pkg/golinters/execinquery/execinquery.go

Lines changed: 0 additions & 19 deletions
This file was deleted.

pkg/golinters/execinquery/execinquery_integration_test.go

Lines changed: 0 additions & 11 deletions
This file was deleted.

pkg/golinters/execinquery/testdata/execinquery.go

Lines changed: 0 additions & 30 deletions
This file was deleted.

pkg/golinters/mnd/mnd.go

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,6 @@ func New(settings *config.MndSettings) *goanalysis.Linter {
1212
return newMND(mnd.Analyzer, settings, nil)
1313
}
1414

15-
func NewGoMND(settings *config.GoMndSettings) *goanalysis.Linter {
16-
// shallow copy because mnd.Analyzer is a global variable.
17-
a := new(analysis.Analyzer)
18-
*a = *mnd.Analyzer
19-
20-
// Used to force the analyzer name to use the same name as the linter.
21-
// This is required to avoid displaying the analyzer name inside the issue text.
22-
a.Name = "gomnd"
23-
24-
var linterCfg map[string]map[string]any
25-
26-
if settings != nil && len(settings.Settings) > 0 {
27-
// Convert deprecated setting.
28-
linterCfg = map[string]map[string]any{
29-
a.Name: settings.Settings["mnd"],
30-
}
31-
}
32-
33-
return newMND(a, &settings.MndSettings, linterCfg)
34-
}
35-
3615
func newMND(a *analysis.Analyzer, settings *config.MndSettings, linterCfg map[string]map[string]any) *goanalysis.Linter {
3716
if len(linterCfg) == 0 && settings != nil {
3817
cfg := make(map[string]any)

pkg/lint/lintersdb/builder_linter.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
"github.com/golangci/golangci-lint/pkg/golinters/errchkjson"
2424
"github.com/golangci/golangci-lint/pkg/golinters/errname"
2525
"github.com/golangci/golangci-lint/pkg/golinters/errorlint"
26-
"github.com/golangci/golangci-lint/pkg/golinters/execinquery"
2726
"github.com/golangci/golangci-lint/pkg/golinters/exhaustive"
2827
"github.com/golangci/golangci-lint/pkg/golinters/exhaustruct"
2928
"github.com/golangci/golangci-lint/pkg/golinters/exportloopref"
@@ -250,12 +249,12 @@ func (LinterBuilder) Build(cfg *config.Config) ([]*linter.Config, error) {
250249
WithLoadForGoAnalysis().
251250
WithURL("https://github.com/polyfloyd/go-errorlint"),
252251

253-
linter.NewConfig(execinquery.New()).
252+
linter.NewConfig(linter.NewNoopDeprecated("execinquery", cfg, linter.DeprecationError)).
254253
WithSince("v1.46.0").
255254
WithPresets(linter.PresetSQL).
256255
WithLoadForGoAnalysis().
257256
WithURL("https://github.com/1uf3/execinquery").
258-
DeprecatedWarning("The repository of the linter has been archived by the owner.", "v1.58.0", ""),
257+
DeprecatedError("The repository of the linter has been archived by the owner.", "v1.58.0", ""),
259258

260259
linter.NewConfig(exhaustive.New(&cfg.LintersSettings.Exhaustive)).
261260
WithSince(" v1.28.0").
@@ -418,11 +417,11 @@ func (LinterBuilder) Build(cfg *config.Config) ([]*linter.Config, error) {
418417
WithPresets(linter.PresetStyle).
419418
WithURL("https://github.com/tommy-muehle/go-mnd"),
420419

421-
linter.NewConfig(mnd.NewGoMND(&cfg.LintersSettings.Gomnd)).
420+
linter.NewConfig(linter.NewNoopDeprecated("gomnd", cfg, linter.DeprecationError)).
422421
WithSince("v1.22.0").
423422
WithPresets(linter.PresetStyle).
424423
WithURL("https://github.com/tommy-muehle/go-mnd").
425-
DeprecatedWarning("The linter has been renamed.", "v1.58.0", "mnd"),
424+
DeprecatedError("The linter has been renamed.", "v1.58.0", "mnd"),
426425

427426
linter.NewConfig(gomoddirectives.New(&cfg.LintersSettings.GoModDirectives)).
428427
WithSince("v1.39.0").

0 commit comments

Comments
 (0)