Show deprecated mark in the CLI linters help (#2350)

* Show deprecated mark in linters list

* fix output deprecated mark in linters list
This commit is contained in:
Danil Ovchinnikov 2021-11-15 05:33:46 +07:00 committed by GitHub
parent e788757b32
commit ec58c48180
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
}
}