Skip to content

Commit

Permalink
chore: hide deprecated flags
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Mar 15, 2024
1 parent 9237a3a commit ad09dde
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/commands/flagsets.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ func setupRunFlagSet(v *viper.Viper, fs *pflag.FlagSet) {

internal.AddFlagAndBind(v, fs, fs.Bool, "tests", "run.tests", true, color.GreenString("Analyze tests (*_test.go)"))

fs.StringSlice("skip-files", nil, color.GreenString("Regexps of files to skip")) // Hack see Loader.applyStringSliceHack
fs.StringSlice("skip-files", nil, color.GreenString("Regexps of files to skip")) // Hack see Loader.applyStringSliceHack
deprecateFlag(fs, "skip-files")
fs.StringSlice("skip-dirs", nil, color.GreenString("Regexps of directories to skip")) // Hack see Loader.applyStringSliceHack
deprecateFlag(fs, "skip-dirs")
internal.AddFlagAndBind(v, fs, fs.Bool, "skip-dirs-use-default", "run.skip-dirs-use-default", true, getDefaultDirectoryExcludeHelp())
deprecateFlag(fs, "skip-dirs-use-default")

const allowParallelDesc = "Allow multiple parallel golangci-lint instances running. " +
"If false (default) - golangci-lint acquires file lock on start."
Expand Down Expand Up @@ -135,3 +138,8 @@ func getDefaultDirectoryExcludeHelp() string {
parts = append(parts, "")
return strings.Join(parts, "\n")
}

func deprecateFlag(fs *pflag.FlagSet, name string) {
_ = fs.MarkHidden(name)
_ = fs.MarkDeprecated(name, "check the documentation for more information.")
}

0 comments on commit ad09dde

Please sign in to comment.