Skip to content

Commit

Permalink
Merge pull request #6 from kunwardeep/kbedi/remove-test-file-only-check
Browse files Browse the repository at this point in the history
remove the check for test only files
  • Loading branch information
kunwardeep authored Nov 12, 2020
2 parents 8baaa34 + 746dcf1 commit 7adadff
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions pkg/paralleltest/paralleltest.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ func NewAnalyzer() *analysis.Analyzer {
}

func run(pass *analysis.Pass) (interface{}, error) {
// Run only for test files
inspector := inspector.New(testFiles(pass))
inspector := inspector.New(pass.Files)

nodeFilter := []ast.Node{
(*ast.FuncDecl)(nil),
Expand Down Expand Up @@ -166,19 +165,6 @@ func getLeftAndRightIdentifier(s ast.Stmt) (string, string) {
return leftIdentifier, rightIdentifier
}

func testFiles(pass *analysis.Pass) []*ast.File {
testFileSuffix := "_test.go"

var testFiles []*ast.File
for _, f := range pass.Files {
fileName := pass.Fset.Position(f.Pos()).Filename
if strings.HasSuffix(fileName, testFileSuffix) {
testFiles = append(testFiles, f)
}
}
return testFiles
}

func methodParallelIsCalledInMethodRun(node ast.Node) bool {
var methodParallelCalled bool
// nolint: gocritic
Expand Down

0 comments on commit 7adadff

Please sign in to comment.