Skip to content

Commit 274aee9

Browse files
committed
revive: fix default values
1 parent 0e7233e commit 274aee9

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

pkg/config/linters_settings.go

+4
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ var defaultLintersSettings = LintersSettings{
7979
Ignore: "",
8080
Qualified: false,
8181
},
82+
Revive: ReviveSettings{
83+
Confidence: 0.8,
84+
Severity: "warning",
85+
},
8286
Testpackage: TestpackageSettings{
8387
SkipRegexp: `(export|internal)_test\.go`,
8488
},

pkg/golinters/revive.go

+1-7
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"reflect"
1010

1111
"github.com/BurntSushi/toml"
12-
"github.com/mgechev/dots"
1312
reviveConfig "github.com/mgechev/revive/config"
1413
"github.com/mgechev/revive/lint"
1514
"github.com/mgechev/revive/rule"
@@ -50,10 +49,10 @@ func NewRevive(cfg *config.ReviveSettings) *goanalysis.Linter {
5049
).WithContextSetter(func(lintCtx *linter.Context) {
5150
analyzer.Run = func(pass *analysis.Pass) (interface{}, error) {
5251
var files []string
53-
5452
for _, file := range pass.Files {
5553
files = append(files, pass.Fset.PositionFor(file.Pos(), false).Filename)
5654
}
55+
packages := [][]string{files}
5756

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

75-
packages, err := dots.ResolvePackages(files, []string{})
76-
if err != nil {
77-
return nil, err
78-
}
79-
8074
failures, err := revive.Lint(packages, lintingRules, *conf)
8175
if err != nil {
8276
return nil, err

0 commit comments

Comments
 (0)