Skip to content

Commit

Permalink
chore: isolate deprecated settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Mar 24, 2024
1 parent b0bc669 commit 41a1013
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
24 changes: 14 additions & 10 deletions pkg/config/linters_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -452,10 +452,12 @@ type FunlenSettings struct {
}

type GciSettings struct {
LocalPrefixes string `mapstructure:"local-prefixes"` // Deprecated
Sections []string `mapstructure:"sections"`
SkipGenerated bool `mapstructure:"skip-generated"`
CustomOrder bool `mapstructure:"custom-order"`

// Deprecated: use Sections instead.
LocalPrefixes string `mapstructure:"local-prefixes"`
}

type GinkgoLinterSettings struct {
Expand Down Expand Up @@ -511,7 +513,7 @@ type GodotSettings struct {
Capital bool `mapstructure:"capital"`
Period bool `mapstructure:"period"`

// Deprecated: use `Scope` instead
// Deprecated: use Scope instead
CheckAll bool `mapstructure:"check-all"`
}

Expand Down Expand Up @@ -548,11 +550,13 @@ type GoImportsSettings struct {
}

type GoMndSettings struct {
Settings map[string]map[string]any // Deprecated
Checks []string `mapstructure:"checks"`
IgnoredNumbers []string `mapstructure:"ignored-numbers"`
IgnoredFiles []string `mapstructure:"ignored-files"`
IgnoredFunctions []string `mapstructure:"ignored-functions"`
Checks []string `mapstructure:"checks"`
IgnoredNumbers []string `mapstructure:"ignored-numbers"`
IgnoredFiles []string `mapstructure:"ignored-files"`
IgnoredFunctions []string `mapstructure:"ignored-functions"`

// Deprecated: use root level settings instead.
Settings map[string]map[string]any
}

type GoModDirectivesSettings struct {
Expand Down Expand Up @@ -814,13 +818,13 @@ type SpancheckSettings struct {
}

type StaticCheckSettings struct {
// Deprecated: use the global `run.go` instead.
GoVersion string `mapstructure:"go"`

Checks []string `mapstructure:"checks"`
Initialisms []string `mapstructure:"initialisms"` // only for stylecheck
DotImportWhitelist []string `mapstructure:"dot-import-whitelist"` // only for stylecheck
HTTPStatusCodeWhitelist []string `mapstructure:"http-status-code-whitelist"` // only for stylecheck

// Deprecated: use the global `run.go` instead.
GoVersion string `mapstructure:"go"`
}

func (s *StaticCheckSettings) HasConfiguration() bool {
Expand Down
6 changes: 3 additions & 3 deletions pkg/config/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ type Run struct {
ExitCodeIfIssuesFound int `mapstructure:"issues-exit-code"`
AnalyzeTests bool `mapstructure:"tests"`

AllowParallelRunners bool `mapstructure:"allow-parallel-runners"`
AllowSerialRunners bool `mapstructure:"allow-serial-runners"`

// Deprecated: use Issues.ExcludeFiles instead.
SkipFiles []string `mapstructure:"skip-files"`
// Deprecated: use Issues.ExcludeDirs instead.
SkipDirs []string `mapstructure:"skip-dirs"`
// Deprecated: use Issues.UseDefaultExcludeDirs instead.
UseDefaultSkipDirs bool `mapstructure:"skip-dirs-use-default"`

AllowParallelRunners bool `mapstructure:"allow-parallel-runners"`
AllowSerialRunners bool `mapstructure:"allow-serial-runners"`

// Deprecated: use Output.ShowStats instead.
ShowStats bool `mapstructure:"show-stats"`
}
Expand Down

0 comments on commit 41a1013

Please sign in to comment.