Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel test linter #1503

Merged
merged 1 commit into from Nov 22, 2020
Merged

Conversation

kunwardeep
Copy link
Contributor

@kunwardeep kunwardeep commented Nov 12, 2020

This PR adds the paralleltest linter. This linter checks for incorrect usage of t.Parallel() in the tests. If the liner is enabled it will complain about each and every place we can use t.Parallel(). It also ensures that if we are using a range over test cases, we reinitialised the test case variable (More Info)

@boring-cyborg
Copy link

boring-cyborg bot commented Nov 12, 2020

Hey, thank you for opening your first Pull Request !

@CLAassistant
Copy link

CLAassistant commented Nov 12, 2020

CLA assistant check
All committers have signed the CLA.

@kunwardeep kunwardeep marked this pull request as draft November 12, 2020 06:00
@kunwardeep kunwardeep marked this pull request as ready for review November 12, 2020 12:29
@tetafro
Copy link

tetafro commented Nov 15, 2020

JFYI there is scopelint that checks incorrect usage of loop variables, but not only in tests.

go.sum Outdated Show resolved Hide resolved
@tetafro
Copy link

tetafro commented Nov 15, 2020

And don't forget to squash commits ;)

Copy link

@tetafro tetafro left a comment

Choose a reason for hiding this comment

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

LGTM

@kunwardeep
Copy link
Contributor Author

Umm, how do get it merged? Is there a separate process for that?

@bombsimon
Copy link
Member

Umm, how do get it merged? Is there a separate process for that?

Nope, nothing else. But probably good to have a few more approvals when merging a new linter.

Copy link
Member

@bombsimon bombsimon left a comment

Choose a reason for hiding this comment

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

LGTM

@tetafro tetafro merged commit b90551c into golangci:master Nov 22, 2020
@golangci-automator
Copy link

Hey, @kunwardeep — we just merged your PR to golangci-lint! 🔥🚀

golangci-lint is built by awesome people like you. Let us say “thanks”: we just invited you to join the GolangCI organization on GitHub.
This will add you to our team of maintainers. Accept the invite by visiting this link.

By joining the team, you’ll be able to label issues, review pull requests, and merge approved pull requests.
More information about contributing is here.

Thanks again!

@wyardley
Copy link

I don't see this in https://golangci-lint.run/usage/linters/ yet -- does it need to be added there?

@bombsimon
Copy link
Member

Not manually, but the make targe to re-generate the documentation and commit those changes needs to be done. I think it should be made automatically once a week with GitHub Actions so it will end up there.

@wyardley
Copy link

@bombsimon thanks! Assumed it was automagic, just wanted to confirm (didn't know there was a delay).

@kunwardeep
Copy link
Contributor Author

yeah.. I thought so too, but after reading this, this looks like a manual step. so here is another PR- https://github.com/golangci/golangci-lint/pull/1526/files

@ldez ldez added the linter: new Support new linter label Dec 7, 2020
@ldez ldez added this to the v1.33 milestone Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linter: new Support new linter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants