55 "slices"
66 "sort"
77 "strings"
8+ "unicode"
9+ "unicode/utf8"
810
911 "github.com/fatih/color"
1012 "github.com/spf13/cobra"
@@ -124,11 +126,21 @@ func printLinters(lcs []*linter.Config) {
124126 })
125127
126128 for _ , lc := range lcs {
129+ desc := lc .Linter .Desc ()
130+
127131 // If the linter description spans multiple lines, truncate everything following the first newline
128- linterDescription := lc .Linter .Desc ()
129- firstNewline := strings .IndexRune (linterDescription , '\n' )
130- if firstNewline > 0 {
131- linterDescription = linterDescription [:firstNewline ]
132+ endFirstLine := strings .IndexRune (desc , '\n' )
133+ if endFirstLine > 0 {
134+ desc = desc [:endFirstLine ]
135+ }
136+
137+ rawDesc := []rune (desc )
138+
139+ r , _ := utf8 .DecodeRuneInString (desc )
140+ rawDesc [0 ] = unicode .ToUpper (r )
141+
142+ if rawDesc [len (rawDesc )- 1 ] != '.' {
143+ rawDesc = append (rawDesc , '.' )
132144 }
133145
134146 deprecatedMark := ""
@@ -137,6 +149,6 @@ func printLinters(lcs []*linter.Config) {
137149 }
138150
139151 _ , _ = fmt .Fprintf (logutils .StdOut , "%s%s: %s [fast: %t, auto-fix: %t]\n " ,
140- color .YellowString (lc .Name ()), deprecatedMark , linterDescription , ! lc .IsSlowLinter (), lc .CanAutoFix )
152+ color .YellowString (lc .Name ()), deprecatedMark , string ( rawDesc ) , ! lc .IsSlowLinter (), lc .CanAutoFix )
141153 }
142154}
0 commit comments