From ec58c481803861d3a35fe01c5a6a43b51c91bf02 Mon Sep 17 00:00:00 2001 From: Danil Ovchinnikov Date: Mon, 15 Nov 2021 05:33:46 +0700 Subject: [PATCH] Show deprecated mark in the CLI linters help (#2350) * Show deprecated mark in linters list * fix output deprecated mark in linters list --- pkg/commands/help.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/commands/help.go b/pkg/commands/help.go index dc3bb47319ee..78fd5b9dbc05 100644 --- a/pkg/commands/help.go +++ b/pkg/commands/help.go @@ -53,8 +53,13 @@ func printLinterConfigs(lcs []*linter.Config) { linterDescription = linterDescription[:firstNewline] } - fmt.Fprintf(logutils.StdOut, "%s%s: %s [fast: %t, auto-fix: %t]\n", color.YellowString(lc.Name()), - altNamesStr, linterDescription, !lc.IsSlowLinter(), lc.CanAutoFix) + deprecatedMark := "" + if lc.IsDeprecated() { + deprecatedMark = " [" + color.RedString("deprecated") + "]" + } + + fmt.Fprintf(logutils.StdOut, "%s%s%s: %s [fast: %t, auto-fix: %t]\n", color.YellowString(lc.Name()), + altNamesStr, deprecatedMark, linterDescription, !lc.IsSlowLinter(), lc.CanAutoFix) } }