Skip to content

Commit 7afe8c5

Browse files
committed
remove test file check
Signed-off-by: yeya24 <[email protected]>
1 parent 13ae064 commit 7afe8c5

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

pkg/golinters/promlinter.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package golinters
33
import (
44
"fmt"
55
"go/ast"
6-
"strings"
76
"sync"
87

98
"github.com/yeya24/promlinter"
@@ -33,16 +32,7 @@ func NewPromlinter() *goanalysis.Linter {
3332
disabledLinters := lintCtx.Cfg.LintersSettings.Promlinter.DisabledLinters
3433

3534
analyzer.Run = func(pass *analysis.Pass) (interface{}, error) {
36-
files := make([]*ast.File, 0)
37-
38-
for _, f := range pass.Files {
39-
if strings.HasSuffix(pass.Fset.Position(f.Pos()).Filename, "_test.go") {
40-
continue
41-
}
42-
43-
files = append(files, f)
44-
}
45-
issues := promlinter.RunLint(pass.Fset, files, promlinter.Setting{
35+
issues := promlinter.RunLint(pass.Fset, pass.Files, promlinter.Setting{
4636
Strict: strict,
4737
DisabledLintFuncs: disabledLinters,
4838
})

0 commit comments

Comments
 (0)