mirror of
https://github.com/mgechev/revive.git
synced 2025-11-23 22:04:49 +02:00
Fix exit codes
This commit is contained in:
7
main.go
7
main.go
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user