Skip to content

Commit ad09dde

Browse files
committed
chore: hide deprecated flags
1 parent 9237a3a commit ad09dde

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pkg/commands/flagsets.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,12 @@ func setupRunFlagSet(v *viper.Viper, fs *pflag.FlagSet) {
4949

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

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

5659
const allowParallelDesc = "Allow multiple parallel golangci-lint instances running. " +
5760
"If false (default) - golangci-lint acquires file lock on start."
@@ -135,3 +138,8 @@ func getDefaultDirectoryExcludeHelp() string {
135138
parts = append(parts, "")
136139
return strings.Join(parts, "\n")
137140
}
141+
142+
func deprecateFlag(fs *pflag.FlagSet, name string) {
143+
_ = fs.MarkHidden(name)
144+
_ = fs.MarkDeprecated(name, "check the documentation for more information.")
145+
}

0 commit comments

Comments
 (0)