Skip to content

Commit ec58c48

Browse files
authoredNov 14, 2021
Show deprecated mark in the CLI linters help (#2350)
* Show deprecated mark in linters list * fix output deprecated mark in linters list
1 parent e788757 commit ec58c48

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed
 

‎pkg/commands/help.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,13 @@ func printLinterConfigs(lcs []*linter.Config) {
5353
linterDescription = linterDescription[:firstNewline]
5454
}
5555

56-
fmt.Fprintf(logutils.StdOut, "%s%s: %s [fast: %t, auto-fix: %t]\n", color.YellowString(lc.Name()),
57-
altNamesStr, linterDescription, !lc.IsSlowLinter(), lc.CanAutoFix)
56+
deprecatedMark := ""
57+
if lc.IsDeprecated() {
58+
deprecatedMark = " [" + color.RedString("deprecated") + "]"
59+
}
60+
61+
fmt.Fprintf(logutils.StdOut, "%s%s%s: %s [fast: %t, auto-fix: %t]\n", color.YellowString(lc.Name()),
62+
altNamesStr, deprecatedMark, linterDescription, !lc.IsSlowLinter(), lc.CanAutoFix)
5863
}
5964
}
6065

0 commit comments

Comments
 (0)
Please sign in to comment.