Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

Fix issue9 #11

Merged
merged 2 commits into from Jul 19, 2022
Merged

Fix issue9 #11

merged 2 commits into from Jul 19, 2022

Conversation

sivchari
Copy link
Owner

@sivchari sivchari commented Jul 19, 2022

@sivchari sivchari merged commit 0886be1 into main Jul 19, 2022
@sivchari sivchari deleted the fix-issue9 branch July 19, 2022 13:41
@@ -50,6 +50,12 @@ func report(pass *analysis.Pass, pos token.Pos, name string) {
return
}

// If prefix is Test or Benchmark, Fuzz, skip
// FYI https://go.dev/blog/examples
if strings.Contains(name, "Test") || strings.Contains(name, "Benchmark") || strings.Contains(name, "Fuzz") {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is too open, you will have false-negative now: if an Ident contains the word Test you will skip the check.
You should be more specific.

Copy link
Contributor

Choose a reason for hiding this comment

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

at least a HasPrefix instead of Contains

Copy link
Owner Author

Choose a reason for hiding this comment

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

Oh, I've mistook. I'll fix it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

false-positive: test function names
2 participants