1
0
mirror of https://github.com/mgechev/revive.git synced 2024-11-24 08:32:22 +02:00

Fix exit codes

This commit is contained in:
mgechev 2018-01-24 15:46:43 -08:00
parent f926547659
commit 6c220f5a65

View File

@ -35,7 +35,7 @@ func main() {
var config = lint.RulesConfig{
"argument-limit": lint.RuleConfig{
Arguments: []string{"3"},
Severity: lint.SeverityWarning,
Severity: lint.SeverityError,
},
}
@ -59,9 +59,12 @@ func main() {
exitCode := 0
for f := range failures {
if c, ok := config[f.RuleName]; ok && c.Severity == lint.SeverityError {
if exitCode == 0 {
exitCode = 1
}
if c, ok := config[f.RuleName]; ok && c.Severity == lint.SeverityError {
exitCode = 2
}
formatChan <- f
}
close(formatChan)