Skip to content

Commit

Permalink
remove test file check
Browse files Browse the repository at this point in the history
Signed-off-by: yeya24 <yb532204897@gmail.com>
  • Loading branch information
yeya24 committed Mar 30, 2021
1 parent 13ae064 commit 7afe8c5
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions pkg/golinters/promlinter.go
Expand Up @@ -3,7 +3,6 @@ package golinters
import (
"fmt"
"go/ast"
"strings"
"sync"

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

analyzer.Run = func(pass *analysis.Pass) (interface{}, error) {
files := make([]*ast.File, 0)

for _, f := range pass.Files {
if strings.HasSuffix(pass.Fset.Position(f.Pos()).Filename, "_test.go") {
continue
}

files = append(files, f)
}
issues := promlinter.RunLint(pass.Fset, files, promlinter.Setting{
issues := promlinter.RunLint(pass.Fset, pass.Files, promlinter.Setting{
Strict: strict,
DisabledLintFuncs: disabledLinters,
})
Expand Down

0 comments on commit 7afe8c5

Please sign in to comment.