diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index cece9e404b7e..8822591b974e 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -129,3 +129,20 @@ jobs: env: # needed for github-action-config.json generation GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + documentation: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Unshallow + run: git fetch --prune --unshallow + - name: Install Go + uses: actions/setup-go@v5 + with: + # https://github.com/actions/setup-go#supported-version-syntax + # ex: + # - 1.18beta1 -> 1.18.0-beta.1 + # - 1.18rc1 -> 1.18.0-rc.1 + go-version: ${{ env.GO_VERSION }} + - name: Check if documentation reference is up to date + run: HELP_RUN=2 go run cmd/golangci-lint/main.go -c .golangci.reference.yml diff --git a/.golangci.reference.yml b/.golangci.reference.yml index f85f91ba42cb..7d574c4ff0a0 100644 --- a/.golangci.reference.yml +++ b/.golangci.reference.yml @@ -70,11 +70,23 @@ run: # Default: false allow-parallel-runners: false + # Allow multiple golangci-lint instances running, but serialize them around a lock. + # If false, golangci-lint exits with an error if it fails to acquire file lock on start. + # Default: false + allow-serial-runners: true + + # Print avg and max memory usage of golangci-lint and total time. + # Default: false + print-resources-usage: true + # Define the Go version limit. # Mainly related to generics support since go1.18. # Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.17 go: '1.19' + # Deprecated: use Timeout instead. + deadline: 5m + # output configuration options output: @@ -659,6 +671,8 @@ linters-settings: # Check that each sentence starts with a capital letter. # Default: false capital: true + # Deprecated: use `Scope` instead + check-all: false godox: # Report any comments starting with keywords, this is useful for TODO or FIXME comments that @@ -775,6 +789,10 @@ linters-settings: ignored-functions: - '^math\.' - '^http\.StatusText$' + # Deprecated + settings: + deprecated: + deprecated: do not use gomoddirectives: # Allow local `replace` directives. @@ -1505,6 +1523,14 @@ linters-settings: # Default: 0.8 confidence: 0.1 + error-code: 1 + + warning-code: 0 + + directives: + name: example + severity: example + rules: # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#add-constant - name: add-constant @@ -2146,6 +2172,9 @@ linters-settings: # Default: false check-exported: true + # Deprecated: isn't supported anymore + algo: cha + unused: # Mark all struct fields that have been written to as used. # Default: true @@ -2313,6 +2342,9 @@ linters-settings: # This logic overrides force-err-cuddling among others. force-short-decl-cuddling: false + structcheck: + exported-fields: false + # The custom section can be used to define linter plugins to be loaded at runtime. # See README documentation for more info. custom: @@ -2328,6 +2360,8 @@ linters-settings: # Optional. original-url: github.com/golangci/example-linter + settings: symbol + linters: # Disable all linters. @@ -2698,6 +2732,10 @@ issues: # Default: false fix: true + # Show issues in any part of update files (requires new-from-rev or new-from-patch). + # Default: false + whole-files: true + severity: # Set the default severity for issues. diff --git a/go.mod b/go.mod index 6ec9138f5b6b..76dc39a69f2b 100644 --- a/go.mod +++ b/go.mod @@ -49,6 +49,7 @@ require ( github.com/golangci/misspell v0.4.1 github.com/golangci/revgrep v0.5.2 github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 + github.com/google/go-cmp v0.6.0 github.com/gordonklaus/ineffassign v0.1.0 github.com/gostaticanalysis/forcetypeassert v0.1.0 github.com/gostaticanalysis/nilerr v0.1.1 @@ -151,7 +152,6 @@ require ( github.com/go-toolsmith/typep v1.1.0 // indirect github.com/gobwas/glob v0.2.3 // indirect github.com/golang/protobuf v1.5.2 // indirect - github.com/google/go-cmp v0.6.0 // indirect github.com/gostaticanalysis/analysisutil v0.7.1 // indirect github.com/gostaticanalysis/comment v1.4.2 // indirect github.com/hashicorp/errwrap v1.0.0 // indirect diff --git a/pkg/commands/run.go b/pkg/commands/run.go index c80857142e5c..18385c0afd11 100644 --- a/pkg/commands/run.go +++ b/pkg/commands/run.go @@ -87,8 +87,8 @@ func initFlagSet(fs *pflag.FlagSet, cfg *config.Config, m *lintersdb.Manager, is fs.BoolVar(&oc.UniqByLine, "uniq-by-line", true, wh("Make issues output unique by line")) fs.BoolVar(&oc.SortResults, "sort-results", false, wh("Sort linter results")) fs.BoolVar(&oc.PrintWelcomeMessage, "print-welcome", false, wh("Print welcome message")) - fs.StringVar(&oc.PathPrefix, "path-prefix", "", wh("Path prefix to add to output")) hideFlag("print-welcome") // no longer used + fs.StringVar(&oc.PathPrefix, "path-prefix", "", wh("Path prefix to add to output")) fs.BoolVar(&cfg.InternalCmdTest, "internal-cmd-test", false, wh("Option is used only for testing golangci-lint command, don't use it")) if err := fs.MarkHidden("internal-cmd-test"); err != nil { diff --git a/pkg/config/config.go b/pkg/config/config.go index 7941f428f4f5..abc1d9930196 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -10,19 +10,19 @@ import ( // Config encapsulates the config data specified in the golangci yaml config file. type Config struct { - cfgDir string // The directory containing the golangci config file. - Run Run - - Output Output - + Run Run `mapstructure:"run"` + Output Output LintersSettings LintersSettings `mapstructure:"linters-settings"` Linters Linters Issues Issues Severity Severity - Version Version - InternalCmdTest bool `mapstructure:"internal-cmd-test"` // Option is used only for testing golangci-lint command, don't use it - InternalTest bool // Option is used only for testing golangci-lint code, don't use it + InternalTest bool // Option is used only for testing golangci-lint code, don't use it + + // Internal usage options, not available to users + cfgDir string `mapstructure:"-"` // The directory containing the golangci config file. + Version Version `mapstructure:"-"` + InternalCmdTest bool `mapstructure:"-"` // Option is used only for testing golangci-lint command, don't use it } // GetConfigDir returns the directory that contains golangci config file. diff --git a/pkg/config/linters_settings.go b/pkg/config/linters_settings.go index a79a2a61e681..482e13fc8a85 100644 --- a/pkg/config/linters_settings.go +++ b/pkg/config/linters_settings.go @@ -213,7 +213,7 @@ type LintersSettings struct { GoModDirectives GoModDirectivesSettings Gomodguard GoModGuardSettings Gosec GoSecSettings - Gosimple StaticCheckSettings + Gosimple CommonStaticCheckSettings Gosmopolitan GosmopolitanSettings Govet GovetSettings Grouper GrouperSettings @@ -245,7 +245,7 @@ type LintersSettings struct { Revive ReviveSettings RowsErrCheck RowsErrCheckSettings SlogLint SlogLintSettings - Staticcheck StaticCheckSettings + Staticcheck CommonStaticCheckSettings Structcheck StructCheckSettings Stylecheck StaticCheckSettings TagAlign TagAlignSettings @@ -774,19 +774,36 @@ type SlogLintSettings struct { } type StaticCheckSettings struct { + CommonStaticCheckSettings `mapstructure:",squash"` + Initialisms []string `mapstructure:"initialisms"` + DotImportWhitelist []string `mapstructure:"dot-import-whitelist"` + HTTPStatusCodeWhitelist []string `mapstructure:"http-status-code-whitelist"` +} + +type CommonStaticCheckSettings 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 + Checks []string `mapstructure:"checks"` } func (s *StaticCheckSettings) HasConfiguration() bool { return len(s.Initialisms) > 0 || len(s.HTTPStatusCodeWhitelist) > 0 || len(s.DotImportWhitelist) > 0 || len(s.Checks) > 0 } +func (s *CommonStaticCheckSettings) GetGoVersion() string { + var goVersion string + if s != nil { + goVersion = s.GoVersion + } + + if goVersion != "" { + return goVersion + } + + return "1.17" +} + type StructCheckSettings struct { CheckExportedFields bool `mapstructure:"exported-fields"` } @@ -863,7 +880,9 @@ type UseStdlibVarsSettings struct { type UnparamSettings struct { CheckExported bool `mapstructure:"check-exported"` - Algo string + + // Deprecated + Algo string } type UnusedSettings struct { @@ -938,7 +957,6 @@ type CustomLinterSettings struct { Description string // OriginalURL The URL containing the source code for the private linter. OriginalURL string `mapstructure:"original-url"` - // Settings plugin settings only work with linterdb.PluginConstructor symbol. Settings any } diff --git a/pkg/config/output.go b/pkg/config/output.go index e8726392055d..3114725e5f78 100644 --- a/pkg/config/output.go +++ b/pkg/config/output.go @@ -28,14 +28,14 @@ var OutFormats = []string{ } type Output struct { - Format string - PrintIssuedLine bool `mapstructure:"print-issued-lines"` - PrintLinterName bool `mapstructure:"print-linter-name"` - UniqByLine bool `mapstructure:"uniq-by-line"` - SortResults bool `mapstructure:"sort-results"` - PrintWelcomeMessage bool `mapstructure:"print-welcome"` - PathPrefix string `mapstructure:"path-prefix"` + Format string + PrintIssuedLine bool `mapstructure:"print-issued-lines"` + PrintLinterName bool `mapstructure:"print-linter-name"` + UniqByLine bool `mapstructure:"uniq-by-line"` + SortResults bool `mapstructure:"sort-results"` + PathPrefix string `mapstructure:"path-prefix"` - // only work with CLI flags because the setup of logs is done before the config file parsing. - Color string + // Internal usage options, not available to users + PrintWelcomeMessage bool `mapstructure:"-"` + Color string `mapstructure:"-"` } diff --git a/pkg/config/reader.go b/pkg/config/reader.go index de203876e969..6e6b7460a28a 100644 --- a/pkg/config/reader.go +++ b/pkg/config/reader.go @@ -7,6 +7,7 @@ import ( "path/filepath" "strings" + "github.com/google/go-cmp/cmp" "github.com/mitchellh/go-homedir" "github.com/mitchellh/mapstructure" "github.com/spf13/viper" @@ -17,6 +18,71 @@ import ( "github.com/golangci/golangci-lint/pkg/logutils" ) +// "... has unset fields: -" https://github.com/mitchellh/mapstructure/issues/350 +// "... has unset fields: ..." required fields not yet implemented https://github.com/mitchellh/mapstructure/issues/7 +const documentationReferenceErrors = `60 error(s) decoding: + +* '' has unset fields: -, InternalTest +* 'Issues.exclude-rules[0]' has unset fields: Source, Text, path-except +* 'Issues.exclude-rules[1]' has unset fields: Path, Source, Text +* 'Issues.exclude-rules[2]' has unset fields: Source, path-except +* 'Issues.exclude-rules[3]' has unset fields: Path, Source, path-except +* 'Issues.exclude-rules[4]' has unset fields: Path, Text, path-except +* 'Output' has unset fields: - +* 'Severity.rules[0]' has unset fields: Path, Source, Text, path-except +* 'linters-settings.Forbidigo.forbid[1]' has unset fields: patternString, pkg +* 'linters-settings.Forbidigo.forbid[4]' has unset fields: msg, patternString +* 'linters-settings.Gocritic' has unset fields: - +* 'linters-settings.Govet' has unset fields: - +* 'linters-settings.Revive.Rules[10]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[11]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[12]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[14]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[16]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[17]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[19]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[20]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[22]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[23]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[25]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[26]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[27]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[28]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[2]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[31]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[34]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[35]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[36]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[37]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[41]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[44]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[45]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[46]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[47]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[48]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[49]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[4]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[50]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[51]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[52]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[53]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[54]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[55]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[59]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[5]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[60]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[62]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[63]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[64]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[65]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[67]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[68]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[6]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[71]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[72]' has unset fields: Arguments +* 'linters-settings.Revive.Rules[7]' has unset fields: Arguments +* 'run' has unset fields: -` + type FileReader struct { log logutils.Log cfg *Config @@ -99,7 +165,21 @@ func (r *FileReader) parseConfig() error { // Needed for forbidigo. mapstructure.TextUnmarshallerHookFunc(), - ))); err != nil { + )), func(config *mapstructure.DecoderConfig) { + config.ErrorUnused = true + if os.Getenv("HELP_RUN") == "2" { + config.ErrorUnset = true + } + }); err != nil { + if os.Getenv("HELP_RUN") == "2" { + if err.Error() == documentationReferenceErrors { + fmt.Printf("Documentation reference (%v) is up to date\n", usedConfigFile) + os.Exit(exitcodes.Success) + } + fmt.Printf("Documentation reference (%v) is NOT up to date\n", usedConfigFile) + fmt.Println(cmp.Diff(err.Error(), documentationReferenceErrors)) + return fmt.Errorf("%s", err) + } return fmt.Errorf("can't unmarshal config by viper: %s", err) } @@ -117,25 +197,6 @@ func (r *FileReader) parseConfig() error { func (r *FileReader) validateConfig() error { c := r.cfg - if len(c.Run.Args) != 0 { - return errors.New("option run.args in config isn't supported now") - } - - if c.Run.CPUProfilePath != "" { - return errors.New("option run.cpuprofilepath in config isn't allowed") - } - - if c.Run.MemProfilePath != "" { - return errors.New("option run.memprofilepath in config isn't allowed") - } - - if c.Run.TracePath != "" { - return errors.New("option run.tracepath in config isn't allowed") - } - - if c.Run.IsVerbose { - return errors.New("can't set run.verbose option with config: only on command-line") - } for i, rule := range c.Issues.ExcludeRules { if err := rule.Validate(); err != nil { return fmt.Errorf("error in exclude rule #%d: %v", i, err) diff --git a/pkg/config/run.go b/pkg/config/run.go index ff812d0a2583..a5f9f7dd1964 100644 --- a/pkg/config/run.go +++ b/pkg/config/run.go @@ -4,37 +4,32 @@ import "time" // Run encapsulates the config options for running the linter analysis. type Run struct { - IsVerbose bool `mapstructure:"verbose"` - Silent bool - CPUProfilePath string - MemProfilePath string - TracePath string - Concurrency int - PrintResourcesUsage bool `mapstructure:"print-resources-usage"` - - Config string // The path to the golangci config file, as specified with the --config argument. - NoConfig bool - - Args []string - - Go string `mapstructure:"go"` - - BuildTags []string `mapstructure:"build-tags"` - ModulesDownloadMode string `mapstructure:"modules-download-mode"` - - ExitCodeIfIssuesFound int `mapstructure:"issues-exit-code"` - AnalyzeTests bool `mapstructure:"tests"` + Concurrency int + PrintResourcesUsage bool `mapstructure:"print-resources-usage"` + Go string `mapstructure:"go"` + BuildTags []string `mapstructure:"build-tags"` + ModulesDownloadMode string `mapstructure:"modules-download-mode"` + ExitCodeIfIssuesFound int `mapstructure:"issues-exit-code"` + AnalyzeTests bool `mapstructure:"tests"` + Timeout time.Duration + SkipFiles []string `mapstructure:"skip-files"` + SkipDirs []string `mapstructure:"skip-dirs"` + UseDefaultSkipDirs bool `mapstructure:"skip-dirs-use-default"` + AllowParallelRunners bool `mapstructure:"allow-parallel-runners"` + AllowSerialRunners bool `mapstructure:"allow-serial-runners"` // Deprecated: Deadline exists for historical compatibility // and should not be used. To set run timeout use Timeout instead. Deadline time.Duration - Timeout time.Duration - - PrintVersion bool - SkipFiles []string `mapstructure:"skip-files"` - SkipDirs []string `mapstructure:"skip-dirs"` - UseDefaultSkipDirs bool `mapstructure:"skip-dirs-use-default"` - AllowParallelRunners bool `mapstructure:"allow-parallel-runners"` - AllowSerialRunners bool `mapstructure:"allow-serial-runners"` + // Internal usage options, not available to users + Config string `mapstructure:"-"` // The path to the golangci config file, as specified with the --config argument. + NoConfig bool `mapstructure:"-"` + IsVerbose bool `mapstructure:"-"` + CPUProfilePath string `mapstructure:"-"` + MemProfilePath string `mapstructure:"-"` + TracePath string `mapstructure:"-"` + Args []string `mapstructure:"-"` + Silent bool `mapstructure:"-"` + PrintVersion bool `mapstructure:"-"` } diff --git a/pkg/golinters/gosimple.go b/pkg/golinters/gosimple.go index de60ded73e2d..ca9086c0899f 100644 --- a/pkg/golinters/gosimple.go +++ b/pkg/golinters/gosimple.go @@ -7,10 +7,10 @@ import ( "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" ) -func NewGosimple(settings *config.StaticCheckSettings) *goanalysis.Linter { - cfg := staticCheckConfig(settings) +func NewGosimple(settings *config.CommonStaticCheckSettings) *goanalysis.Linter { + cfg := commonStaticCheckConfig(settings) - analyzers := setupStaticCheckAnalyzers(simple.Analyzers, getGoVersion(settings), cfg.Checks) + analyzers := setupStaticCheckAnalyzers(simple.Analyzers, settings.GetGoVersion(), cfg.Checks) return goanalysis.NewLinter( "gosimple", diff --git a/pkg/golinters/staticcheck.go b/pkg/golinters/staticcheck.go index 673484630aba..5645b9d470b7 100644 --- a/pkg/golinters/staticcheck.go +++ b/pkg/golinters/staticcheck.go @@ -7,9 +7,9 @@ import ( "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" ) -func NewStaticcheck(settings *config.StaticCheckSettings) *goanalysis.Linter { - cfg := staticCheckConfig(settings) - analyzers := setupStaticCheckAnalyzers(staticcheck.Analyzers, getGoVersion(settings), cfg.Checks) +func NewStaticcheck(settings *config.CommonStaticCheckSettings) *goanalysis.Linter { + cfg := commonStaticCheckConfig(settings) + analyzers := setupStaticCheckAnalyzers(staticcheck.Analyzers, settings.GetGoVersion(), cfg.Checks) return goanalysis.NewLinter( "staticcheck", diff --git a/pkg/golinters/staticcheck_common.go b/pkg/golinters/staticcheck_common.go index 0eb21ec9cfb0..cb4bc552ae70 100644 --- a/pkg/golinters/staticcheck_common.go +++ b/pkg/golinters/staticcheck_common.go @@ -54,6 +54,24 @@ func setAnalyzerGoVersion(a *analysis.Analyzer, goVersion string) { } } +func commonStaticCheckConfig(settings *config.CommonStaticCheckSettings) *scconfig.Config { + var cfg *scconfig.Config + + if settings == nil || len(settings.Checks) == 0 { + return &scconfig.Config{ + Checks: []string{"*"}, // override for compatibility reason. Must drop in the next major version. + } + } + + cfg = &scconfig.Config{ + Checks: settings.Checks, + } + + cfg.Checks = normalizeList(cfg.Checks) + + return cfg +} + func staticCheckConfig(settings *config.StaticCheckSettings) *scconfig.Config { var cfg *scconfig.Config diff --git a/pkg/lint/lintersdb/manager.go b/pkg/lint/lintersdb/manager.go index c4e222493d5e..27cf6b954e65 100644 --- a/pkg/lint/lintersdb/manager.go +++ b/pkg/lint/lintersdb/manager.go @@ -99,7 +99,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config { goModDirectivesCfg *config.GoModDirectivesSettings gomodguardCfg *config.GoModGuardSettings gosecCfg *config.GoSecSettings - gosimpleCfg *config.StaticCheckSettings + gosimpleCfg *config.CommonStaticCheckSettings gosmopolitanCfg *config.GosmopolitanSettings govetCfg *config.GovetSettings grouperCfg *config.GrouperSettings @@ -131,7 +131,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config { reviveCfg *config.ReviveSettings rowserrcheckCfg *config.RowsErrCheckSettings sloglintCfg *config.SlogLintSettings - staticcheckCfg *config.StaticCheckSettings + staticcheckCfg *config.CommonStaticCheckSettings structcheckCfg *config.StructCheckSettings stylecheckCfg *config.StaticCheckSettings tagalignCfg *config.TagAlignSettings @@ -868,7 +868,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config { WithLoadForGoAnalysis(). WithURL("https://github.com/mvdan/unparam"), - linter.NewConfig(golinters.NewUnused(unusedCfg, staticcheckCfg)). + linter.NewConfig(golinters.NewUnused(unusedCfg, stylecheckCfg)). WithEnabledByDefault(). WithSince("v1.20.0"). WithLoadForGoAnalysis(). diff --git a/test/run_test.go b/test/run_test.go index 2ec4b64280a0..1a8f04c57d1d 100644 --- a/test/run_test.go +++ b/test/run_test.go @@ -475,7 +475,6 @@ func TestConfigFileIsDetected(t *testing.T) { t.Parallel() testshared.NewRunnerBuilder(t). - // WithNoConfig(). WithTargetPath(test.targetPath). Runner(). Run(). diff --git a/test/testdata/configs/importas_noalias.yml b/test/testdata/configs/importas_noalias.yml index ad94e57ebe6b..3d09ab79e6e2 100644 --- a/test/testdata/configs/importas_noalias.yml +++ b/test/testdata/configs/importas_noalias.yml @@ -1,4 +1,3 @@ linters-settings: importas: - fff: fmt - std_os: os + alias: [] diff --git a/test/testdata_etc/unused_exported/golangci.yml b/test/testdata_etc/unused_exported/golangci.yml index a49f3d01e0ce..f14eb9ba3603 100644 --- a/test/testdata_etc/unused_exported/golangci.yml +++ b/test/testdata_etc/unused_exported/golangci.yml @@ -4,4 +4,4 @@ linters: - unused linters-settings: unused: - check-exported: true + exported-is-used: true