1
0
mirror of https://github.com/mgechev/revive.git synced 2025-11-25 22:12:38 +02:00

Update the cli formatter

This commit is contained in:
mgechev
2017-08-29 10:53:29 -07:00
parent 1cdf90891b
commit dc72f8eca8

View File

@@ -72,7 +72,14 @@ func (f *CLIFormatter) Format(failures []rule.Failure) (string, error) {
output += buf.String() + "\n"
}
suffix := fmt.Sprintf("\n ✖ %d %s (%d errors) (%d warnings)", total, ps, totalErrors, total-totalErrors)
suffix := fmt.Sprintf(" %d %s (%d errors) (%d warnings)", total, ps, totalErrors, total-totalErrors)
if total > 0 && totalErrors > 0 {
suffix = chalk.Red.Color("\n ✖" + suffix)
} else if total > 0 && totalErrors == 0 {
suffix = chalk.Yellow.Color("\n ✖" + suffix)
} else {
suffix = chalk.Green.Color("\n" + suffix)
}
return output + suffix, nil
}