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

docs: add forbidigo example that uses comments #2599

Merged
merged 1 commit into from Feb 19, 2022

Conversation

@craigfurman
Copy link
Member

@craigfurman craigfurman commented Feb 18, 2022

Add an example of a recently-added forbidigo feature, comments (ashanbrown/forbidigo#11).

Is the docs site (https://golangci-lint.run/usage/linters/#forbidigo) generated from this file?

@boring-cyborg
Copy link

@boring-cyborg boring-cyborg bot commented Feb 18, 2022

Hey, thank you for opening your first Pull Request !

@ldez ldez changed the title Add forbidigo example that uses comments forbidigo: add example that uses comments Feb 18, 2022
@butuzov
Copy link
Member

@butuzov butuzov commented Feb 18, 2022

Can message be a bit more explanatory? ( in the example ). Cool feature, however, sad it removed proper error message.

@ldez
Copy link
Member

@ldez ldez commented Feb 18, 2022

Is the docs site (https://golangci-lint.run/usage/linters/#forbidigo) generated from this file?

Yes the linters page is generated from the .golangci.example.yml file.

@craigfurman
Copy link
Member Author

@craigfurman craigfurman commented Feb 18, 2022

Cool feature, however, sad it removed proper error message

I'm not sure I understand, what proper error message does this feature remove?

Can message be a bit more explanatory? ( in the example ).

Could do, although given that this is a contrived example, we'd have to invent some context. Maybe "don't use fmt, use some logger instead", but it feels weird to name any arbitrary logger in a golangci example. Please leave a suggestion if you have something specific in mind though 👍

@CLAassistant
Copy link

@CLAassistant CLAassistant commented Feb 18, 2022

CLA assistant check
All committers have signed the CLA.

@butuzov
Copy link
Member

@butuzov butuzov commented Feb 19, 2022

Never mind about the error, i didn't notice you move regexp compilation into parse. And yeah, more actionable examples
like

       - '\.Debug\(\)\.(# Do not commit Debug code)?' # db Debug()

http_test.go:64:16: use of suite.DB.Exec(dropSQLQuery).Debug().Error forbidden because "Do not commit Debug code" (forbidigo)

@craigfurman craigfurman force-pushed the forbidigo-comment-example branch from a016aa8 to 92e8582 Feb 19, 2022
@craigfurman
Copy link
Member Author

@craigfurman craigfurman commented Feb 19, 2022

Done

@butuzov butuzov self-requested a review Feb 19, 2022
@butuzov
Copy link
Member

@butuzov butuzov commented Feb 19, 2022

Will merge one get to the laptop. Thank you!

@ldez ldez merged commit 374b3fd into golangci:master Feb 19, 2022
17 checks passed
@golangci-automator
Copy link

@golangci-automator golangci-automator bot commented Feb 19, 2022

Hey, @craigfurman — 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!

@ldez ldez changed the title forbidigo: add example that uses comments docs: add forbidigo example that uses comments Feb 19, 2022
@craigfurman craigfurman deleted the forbidigo-comment-example branch Feb 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants