dev: cleanup config package (#1929)

* split config section into files.
* extract anonymous types.
* sort linters alphabetically.
This commit is contained in:
Ludovic Fernandez 2021-04-24 16:29:04 +02:00 committed by GitHub
parent 12e3251a61
commit db80e16aba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 725 additions and 680 deletions

18
pkg/config/severity.go Normal file
View file

@ -0,0 +1,18 @@
package config
const severityRuleMinConditionsCount = 1
type Severity struct {
Default string `mapstructure:"default-severity"`
CaseSensitive bool `mapstructure:"case-sensitive"`
Rules []SeverityRule `mapstructure:"rules"`
}
type SeverityRule struct {
BaseRule `mapstructure:",squash"`
Severity string
}
func (s *SeverityRule) Validate() error {
return s.BaseRule.Validate(severityRuleMinConditionsCount)
}