Skip to content

Commit 9135a4c

Browse files
committed
revice: add log for ignored rules
1 parent 79bac57 commit 9135a4c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

pkg/golinters/revive.go

+10-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,15 @@ 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 performance problem (https://github.com/golangci/golangci-lint/issues/2997)", strings.Join(ignored, ","))
410419
}
411420
}

0 commit comments

Comments
 (0)