Skip to content

Commit

Permalink
refactor(formatter): change params order in writeRuleFailure
Browse files Browse the repository at this point in the history
  • Loading branch information
muthukrishnan24 committed Nov 28, 2021
1 parent cbf329d commit fb85e69
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions formatter/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ func writeFailure(res *lint.Failure) string {

errs, warns, others := bySeverity(res)

writeRuleFailure(str, "Errors", errs, "❌")
writeRuleFailure(str, "Warnings", warns, "!")
writeRuleFailure(str, "Other Severities", others, "?")
writeRuleFailure(str, "", "Errors", errs)
writeRuleFailure(str, "!", "Warnings", warns)
writeRuleFailure(str, "?", "Other Severities", others)

fmt.Fprintf(str, "\n\nTotal %d errors, %d warnings, %d other severities", len(errs), len(warns), len(others))
return strings.Trim(str.String(), "\n")
}

func writeRuleFailure(w *strings.Builder, title string, resArr []*lint.RuleFailure, sign string) {
func writeRuleFailure(w *strings.Builder, sign, title string, resArr []*lint.RuleFailure) {
if len(resArr) == 0 {
return
}
Expand Down

0 comments on commit fb85e69

Please sign in to comment.