@@ -67,6 +67,14 @@ func (c *Runner) Run(paths []string) error {
6767 }
6868 }
6969
70+ for pattern , count := range c .opts .excludedPathCounter {
71+ if c .opts .warnUnused && count == 0 {
72+ c .log .Warnf ("The pattern %q match no issues" , pattern )
73+ } else {
74+ c .log .Infof ("Skipped %d issues by pattern %q" , count , pattern )
75+ }
76+ }
77+
7078 return nil
7179}
7280
@@ -181,6 +189,9 @@ type RunnerOptions struct {
181189 diff bool
182190 colors bool
183191 stdin bool
192+
193+ warnUnused bool
194+ excludedPathCounter map [* regexp.Regexp ]int
184195}
185196
186197func NewRunnerOptions (cfg * config.Config , diff , diffColored , stdin bool ) (RunnerOptions , error ) {
@@ -190,11 +201,13 @@ func NewRunnerOptions(cfg *config.Config, diff, diffColored, stdin bool) (Runner
190201 }
191202
192203 opts := RunnerOptions {
193- basePath : basePath ,
194- generated : cfg .Formatters .Exclusions .Generated ,
195- diff : diff || diffColored ,
196- colors : diffColored ,
197- stdin : stdin ,
204+ basePath : basePath ,
205+ generated : cfg .Formatters .Exclusions .Generated ,
206+ diff : diff || diffColored ,
207+ colors : diffColored ,
208+ stdin : stdin ,
209+ excludedPathCounter : make (map [* regexp.Regexp ]int ),
210+ warnUnused : cfg .Formatters .Exclusions .WarnUnused ,
198211 }
199212
200213 for _ , pattern := range cfg .Formatters .Exclusions .Paths {
@@ -204,6 +217,7 @@ func NewRunnerOptions(cfg *config.Config, diff, diffColored, stdin bool) (Runner
204217 }
205218
206219 opts .patterns = append (opts .patterns , exp )
220+ opts .excludedPathCounter [exp ] = 0
207221 }
208222
209223 return opts , nil
@@ -221,6 +235,7 @@ func (o RunnerOptions) MatchAnyPattern(path string) (bool, error) {
221235
222236 for _ , pattern := range o .patterns {
223237 if pattern .MatchString (rel ) {
238+ o .excludedPathCounter [pattern ]++
224239 return true , nil
225240 }
226241 }
0 commit comments