Skip to content

Commit

Permalink
revice: add log for ignored rules
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Jul 20, 2022
1 parent 79bac57 commit 9135a4c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/golinters/revive.go
Expand Up @@ -7,6 +7,7 @@ import (
"go/token"
"os"
"reflect"
"strings"
"sync"

"github.com/BurntSushi/toml"
Expand Down Expand Up @@ -405,7 +406,15 @@ func ignoreRules(conf *lint.Config) {
"var-declaration",
}

var ignored []string
for _, s := range f {
delete(conf.Rules, s)
if _, ok := conf.Rules[s]; ok {
delete(conf.Rules, s)
ignored = append(ignored, s)
}
}

if len(ignored) > 0 {
linterLogger.Warnf("revive: the following rules (%s) are ignored due to performance problem (https://github.com/golangci/golangci-lint/issues/2997)", strings.Join(ignored, ","))
}
}

0 comments on commit 9135a4c

Please sign in to comment.