Skip to content

Commit a52e438

Browse files
committed
dev: enhance help linters output on fast and auto-fix capabilities
1 parent 127edc0 commit a52e438

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

pkg/commands/help.go

+13-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,18 @@ func printLinters(lcs []*linter.Config) {
148148
deprecatedMark = " [" + color.RedString("deprecated") + "]"
149149
}
150150

151-
_, _ = fmt.Fprintf(logutils.StdOut, "%s%s: %s [fast: %t, auto-fix: %t]\n",
152-
color.YellowString(lc.Name()), deprecatedMark, string(rawDesc), !lc.IsSlowLinter(), lc.CanAutoFix)
151+
var capability string
152+
switch isFast := !lc.IsSlowLinter(); {
153+
case isFast && lc.CanAutoFix:
154+
capability = " [" + color.GreenString("fast, auto-fix") + "]"
155+
case isFast:
156+
capability = " [" + color.GreenString("fast") + "]"
157+
case lc.CanAutoFix:
158+
capability = " [" + color.GreenString("auto-fix") + "]"
159+
default:
160+
}
161+
162+
_, _ = fmt.Fprintf(logutils.StdOut, "%s%s: %s%s\n",
163+
color.YellowString(lc.Name()), deprecatedMark, string(rawDesc), capability)
153164
}
154165
}

0 commit comments

Comments
 (0)