@@ -16,7 +16,7 @@ type Options struct {
1616 Contact string `mapstructure:"contact"`
1717 Handlers map [string ]hook.Rule `mapstructure:"handlers"`
1818 DocsLink string `mapstructure:"docs-link"`
19- ErrorMessagePrefix string `mapstructure:"error-message-prefix "`
19+ ErrorMessagePrefix string `mapstructure:"error_message_prefix "`
2020 HookFile string `mapstructure:"hook-file"`
2121 HookInput string `mapstructure:"hook-input"`
2222 HookType string `mapstructure:"hook-type"`
@@ -30,7 +30,7 @@ type Options struct {
3030 Output string `mapstructure:"output"`
3131 OutputFormat string `mapstructure:"output-format"`
3232 PluginsDirectory string `mapstructure:"plugins-directory"`
33- Security `mapstructure:"security"`
33+ * Security `mapstructure:"security"`
3434 Verbose bool `mapstructure:"verbose"`
3535 URI string `mapstructure:"uri"`
3636}
@@ -57,6 +57,16 @@ func (options *Options) Validate() error {
5757 if options .Concurrent == 0 {
5858 options .Concurrent = runtime .NumCPU ()
5959 }
60+ if options .Security != nil && len (options .Security .Rules ) > 0 {
61+ for index , rule := range options .Security .Rules {
62+ if rule .Description == "" || rule .Regexp == "" {
63+ options .Security .Rules = append (options .Security .Rules [:index ], options .Security .Rules [index + 1 :]... )
64+ }
65+ if rule .Severity == "" {
66+ rule .Severity = "INFO"
67+ }
68+ }
69+ }
6070 return nil
6171}
6272
0 commit comments