Skip to content

Commit ad545e6

Browse files
aimuzldez
authored andcommitted
dev: improve formatting and description in flagsets (#4636)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
1 parent 7048511 commit ad545e6

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pkg/commands/flagsets.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ func setupLintersFlagSet(v *viper.Viper, fs *pflag.FlagSet) {
2626
color.GreenString("Enable only fast linters from enabled linters set (first run won't be fast)"))
2727

2828
internal.AddHackedStringSliceP(fs, "presets", "p",
29-
color.GreenString(fmt.Sprintf("Enable presets (%s) of linters. Run 'golangci-lint help linters' to see them. "+
30-
"This option implies option --disable-all", strings.Join(lintersdb.AllPresets(), "|"))))
29+
color.GreenString(fmt.Sprintf("Enable presets (%s) of linters.\n"+
30+
"Run 'golangci-lint help linters' to see them.\n"+
31+
"This option implies option --disable-all",
32+
strings.Join(lintersdb.AllPresets(), "|"),
33+
)))
3134

3235
fs.StringSlice("enable-only", nil,
3336
color.GreenString("Override linters configuration section to only run the specific linter(s)")) // Flags only.
@@ -53,11 +56,11 @@ func setupRunFlagSet(v *viper.Viper, fs *pflag.FlagSet) {
5356
internal.AddDeprecatedFlagAndBind(v, fs, fs.Bool, "skip-dirs-use-default", "run.skip-dirs-use-default", true,
5457
getDefaultDirectoryExcludeHelp())
5558

56-
const allowParallelDesc = "Allow multiple parallel golangci-lint instances running. " +
59+
const allowParallelDesc = "Allow multiple parallel golangci-lint instances running.\n" +
5760
"If false (default) - golangci-lint acquires file lock on start."
5861
internal.AddFlagAndBind(v, fs, fs.Bool, "allow-parallel-runners", "run.allow-parallel-runners", false,
5962
color.GreenString(allowParallelDesc))
60-
const allowSerialDesc = "Allow multiple golangci-lint instances running, but serialize them around a lock. " +
63+
const allowSerialDesc = "Allow multiple golangci-lint instances running, but serialize them around a lock.\n" +
6164
"If false (default) - golangci-lint exits with an error if it fails to acquire file lock on start."
6265
internal.AddFlagAndBind(v, fs, fs.Bool, "allow-serial-runners", "run.allow-serial-runners", false, color.GreenString(allowSerialDesc))
6366
}

0 commit comments

Comments
 (0)