From 574a8b42a46fe27672536ee1820b8a31e04712ac 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) } }