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:
parent
f926547659
commit
6c220f5a65
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)
|
||||
|
Loading…
Reference in New Issue
Block a user