Skip to content

Commit

Permalink
Show deprecated mark in the CLI linters help (golangci#2350)
Browse files Browse the repository at this point in the history
* Show deprecated mark in linters list

* fix output deprecated mark in linters list
  • Loading branch information
Danil42Russia authored and SeigeC committed Apr 4, 2023
1 parent dc501ea commit 574a8b4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/commands/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down

0 comments on commit 574a8b4

Please sign in to comment.