Skip to content

Conversation

@kunwardeep
Copy link
Owner

Issue: #50

@kunwardeep kunwardeep requested a review from Copilot October 14, 2025 01:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a false positive issue in the paralleltest linter where test functions using builder patterns to generate test functions were incorrectly flagged as missing parallel calls, even when the returned functions properly called t.Parallel().

  • Added support for analyzing function calls that return test functions (builder pattern)
  • Enhanced the analyzer to inspect returned function literals for t.Parallel() calls
  • Added comprehensive test cases covering both compliant and non-compliant builder patterns

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
pkg/paralleltest/paralleltest.go Implements new logic to handle builder function pattern analysis by adding checkBuilderFunctionForParallel method
pkg/paralleltest/testdata/src/t/t_test.go Adds test cases to verify the fix works correctly for both compliant and non-compliant builder patterns

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@kunwardeep kunwardeep requested a review from Copilot October 14, 2025 01:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +267 to +270
if hasParallel {
return false
}

Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This early return check is redundant since the same condition is checked at line 306 with return !hasParallel. The early return here prevents unnecessary traversal once parallel is found, but the logic at line 306 should be return true to continue inspection when parallel is not found.

Suggested change
if hasParallel {
return false
}

Copilot uses AI. Check for mistakes.
@kunwardeep kunwardeep merged commit a73b878 into main Oct 14, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants