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

Add forbidigo linter #1569

Merged
merged 1 commit into from
Dec 24, 2020
Merged

Add forbidigo linter #1569

merged 1 commit into from
Dec 24, 2020

Conversation

ashanbrown
Copy link
Contributor

@ashanbrown ashanbrown commented Dec 21, 2020

Forbidigo forbids identifiers. It can be used to forbid code that is useful for debugging but should not be merged to the master branch. I've found it particularly useful to make sure I don't commit fmt.Print.* statements or ginkgo.F.* commands that I've introduced during local debugging.

Not sure if there is another linter that already does this. Please let me know if there is.

Base linter is at https://github.com/ashanbrown/forbidigo

@ldez ldez added the linter: new Support new linter label Dec 21, 2020
@ashanbrown ashanbrown force-pushed the asb/forbidigo branch 3 times, most recently from 7293bd5 to 110a30c Compare December 21, 2020 17:29
@ashanbrown ashanbrown marked this pull request as ready for review December 21, 2020 18:33
@ldez ldez self-requested a review December 21, 2020 19:45
Copy link
Member

@ldez ldez left a comment

Choose a reason for hiding this comment

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

Could you also run a go mod tidy?

Thank you.

pkg/golinters/forbidigo.go Outdated Show resolved Hide resolved
pkg/golinters/forbidigo.go Outdated Show resolved Hide resolved
@ashanbrown
Copy link
Contributor Author

Should we be verifying that go mod tidy produces no changes in CI? Also, I'm wondering if we should consider linter checks for the other items you mentioned (whitespace and shadowed imports).

Forbidigo forbids identifiers.  It can be used to forbid code that is useful
for debugging but should not be merged to the master branch.
@ldez
Copy link
Member

ldez commented Dec 24, 2020

@ashanbrown there was an RP to change this behavior #1397. I think that this PR can be reverted since dependabot is now able to manage go.sum file.

Copy link
Member

@ldez ldez left a comment

Choose a reason for hiding this comment

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

LGTM

@ldez ldez merged commit 222076f into golangci:master Dec 24, 2020
@ldez ldez added this to the v1.34 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

4 participants