Skip to content

Commit

Permalink
refactor: remove redundant fmt.Fprintln calls
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear committed Nov 15, 2024
1 parent 3378f70 commit c7259d0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions formatter/friendly.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ func (f *Friendly) Format(failures <-chan lint.Failure, config lint.Config) (str
func (f *Friendly) printFriendlyFailure(w io.Writer, failure lint.Failure, severity lint.Severity) {
f.printHeaderRow(w, failure, severity)
f.printFilePosition(w, failure)
fmt.Fprintln(w)
fmt.Fprintln(w)
fmt.Fprintf(w, "\n\n")
}

func (f *Friendly) printHeaderRow(w io.Writer, failure lint.Failure, severity lint.Severity) {
Expand Down Expand Up @@ -98,13 +97,11 @@ func (*Friendly) printSummary(w io.Writer, errors, warnings int) {
}
str := fmt.Sprintf("%d %s (%d %s, %d %s)", errors+warnings, problemsLabel, errors, errorsLabel, warnings, warningsLabel)
if errors > 0 {
fmt.Fprintf(w, "%s %s\n", emoji, color.RedString(str))
fmt.Fprintln(w)
fmt.Fprintf(w, "%s %s\n\n", emoji, color.RedString(str))
return
}
if warnings > 0 {
fmt.Fprintf(w, "%s %s\n", emoji, color.YellowString(str))
fmt.Fprintln(w)
fmt.Fprintf(w, "%s %s\n\n", emoji, color.YellowString(str))
return
}
}
Expand Down

0 comments on commit c7259d0

Please sign in to comment.