Skip to content

Commit 512ac9f

Browse files
committed
revice: add log for ignored rules
1 parent 79bac57 commit 512ac9f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

pkg/golinters/revive.go

+12-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"go/token"
88
"os"
99
"reflect"
10+
"strings"
1011
"sync"
1112

1213
"github.com/BurntSushi/toml"
@@ -405,7 +406,17 @@ func ignoreRules(conf *lint.Config) {
405406
"var-declaration",
406407
}
407408

409+
var ignored []string
408410
for _, s := range f {
409-
delete(conf.Rules, s)
411+
if _, ok := conf.Rules[s]; ok {
412+
delete(conf.Rules, s)
413+
ignored = append(ignored, s)
414+
}
415+
}
416+
417+
if len(ignored) > 0 {
418+
linterLogger.Warnf("revive: the following rules (%s) are ignored due to a performance problem "+
419+
"(https://github.com/golangci/golangci-lint/issues/2997)",
420+
strings.Join(ignored, ","))
410421
}
411422
}

0 commit comments

Comments
 (0)