@@ -136,6 +136,7 @@ func FiltersWithMacros(macros map[string]*Macro) *Filters {
136136// Rules contains attributes that describe the location of
137137// rule resources.
138138type Rules struct {
139+ Enabled bool `json:"enabled" yaml:"enabled"`
139140 FromPaths []string `json:"from-paths" yaml:"from-paths"`
140141 FromURLs []string `json:"from-urls" yaml:"from-urls"`
141142}
@@ -171,12 +172,14 @@ type ActionContext struct {
171172}
172173
173174const (
175+ rulesEnabled = "filters.rules.enabled"
174176 rulesFromPaths = "filters.rules.from-paths"
175177 rulesFromURLs = "filters.rules.from-urls"
176178 macrosFromPaths = "filters.macros.from-paths"
177179)
178180
179181func (f * Filters ) initFromViper (v * viper.Viper ) {
182+ f .Rules .Enabled = v .GetBool (rulesEnabled )
180183 f .Rules .FromPaths = v .GetStringSlice (rulesFromPaths )
181184 f .Rules .FromURLs = v .GetStringSlice (rulesFromURLs )
182185 f .Macros .FromPaths = v .GetStringSlice (macrosFromPaths )
@@ -307,6 +310,10 @@ func (f *Filters) LoadGroups() error {
307310 f .groups = append (f .groups , groups ... )
308311 }
309312
313+ if len (f .groups ) == 0 {
314+ log .Warnf ("no rules were loaded from [%s] path(s)" , strings .Join (f .Rules .FromPaths , "," ))
315+ }
316+
310317 // check for duplicate rule groups
311318 groupNames := make (map [string ]bool )
312319 for _ , group := range f .groups {
0 commit comments