revive: allow to disable rule ()

This commit is contained in:
ofw 2021-06-15 15:28:07 +03:00 committed by GitHub
parent 6a269af7a6
commit eed344f619
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

@ -380,6 +380,7 @@ type ReviveSettings struct {
Name string
Arguments []interface{}
Severity string
Disabled bool
}
ErrorCode int `mapstructure:"error-code"`
WarningCode int `mapstructure:"warning-code"`

@ -200,6 +200,7 @@ func createConfigMap(cfg *config.ReviveSettings) map[string]interface{} {
rawRules[s.Name] = map[string]interface{}{
"severity": s.Severity,
"arguments": safeTomlSlice(s.Arguments),
"disabled": s.Disabled,
}
}