-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat: add gocheckcompilerdirectives #3463
Conversation
Hey, thank you for opening your first Pull Request ! |
In order for a pull request adding a linter to be reviewed, the linter and the PR must follow some requirements. Pull Request Description
Linter
The Linter Tests Inside Golangci-lint
|
@ldez Thanks for posting the list of instructions. I've reviewed the list and after making a couple changes to the PR I believe it satisfies the requirements. |
This comment was marked as outdated.
This comment was marked as outdated.
I would like to suggest another name for your linter because "directives" is a generic term (for example |
That's a good idea, I'd be happy to rename it. I'll rename it to |
it can be |
I also maintain |
It's always possible to change or at least to use a new pattern 😉 |
I've pushed a change to this pull request updating the name of the linter to |
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the linter position in the manager is not right (alphabetically ordered)
Edit: misread
@ldez Thanks for re-reviewing. I've merged the two suggested changes removing the config. Thanks, I didn't realize I could simply pass nil when no config was available. |
Co-authored-by: Ludovic Fernandez <[email protected]>
Co-authored-by: Ludovic Fernandez <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Add
gocheckcompilerdirectives
that checks that compiler directives (//go:
comments) are valid, and catches easy mistakes.https://github.com/leighmcculloch/gocheckcompilerdirectives
Compiler directives are comments in the form of
//go:
that provide an instruction to the compiler. For example,//go:generate
,//go:embed
,//go:build
, etc.Compiler directives are easy to make mistakes with. The linter will detect the following mistakes.
Adding a space in between the comment bars and the first character, e.g.
// go:
, will cause the compiler to silently ignore the comment.Mistyping a directives name, e.g.
//go:embod
, will cause the compiler to silently ignore the comment.