Skip to content

Commit

Permalink
revive: fix default values
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Feb 22, 2022
1 parent 0e7233e commit 274aee9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 4 additions & 0 deletions pkg/config/linters_settings.go
Expand Up @@ -79,6 +79,10 @@ var defaultLintersSettings = LintersSettings{
Ignore: "",
Qualified: false,
},
Revive: ReviveSettings{
Confidence: 0.8,
Severity: "warning",
},
Testpackage: TestpackageSettings{
SkipRegexp: `(export|internal)_test\.go`,
},
Expand Down
8 changes: 1 addition & 7 deletions pkg/golinters/revive.go
Expand Up @@ -9,7 +9,6 @@ import (
"reflect"

"github.com/BurntSushi/toml"
"github.com/mgechev/dots"
reviveConfig "github.com/mgechev/revive/config"
"github.com/mgechev/revive/lint"
"github.com/mgechev/revive/rule"
Expand Down Expand Up @@ -50,10 +49,10 @@ func NewRevive(cfg *config.ReviveSettings) *goanalysis.Linter {
).WithContextSetter(func(lintCtx *linter.Context) {
analyzer.Run = func(pass *analysis.Pass) (interface{}, error) {
var files []string

for _, file := range pass.Files {
files = append(files, pass.Fset.PositionFor(file.Pos(), false).Filename)
}
packages := [][]string{files}

conf, err := getReviveConfig(cfg)
if err != nil {
Expand All @@ -72,11 +71,6 @@ func NewRevive(cfg *config.ReviveSettings) *goanalysis.Linter {
return nil, err
}

packages, err := dots.ResolvePackages(files, []string{})
if err != nil {
return nil, err
}

failures, err := revive.Lint(packages, lintingRules, *conf)
if err != nil {
return nil, err
Expand Down

0 comments on commit 274aee9

Please sign in to comment.