-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
detects whether declarations of exported variables, constants, functions, etc. have comments. #4828
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
Comments
Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors. |
Hello, this already exists inside golangci-lint: revive, stylecheck, etc. |
The only existing linter I know that looks like what is requested would be revive:comment-density https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#comments-density |
thank for your reply |
This issue is about comments, so there several rules inside revive and stylecheck. But remember that by default, golangci-lint skips those reports. https://golangci-lint.run/usage/false-positives/#default-exclusions To disable those exclusions: issues:
exclude-use-default: false |
Thanks for providing this information. I totally missed that parameter even I'm using golangci-lint for a while. I'll have a look, thanks |
Welcome
Your feature request related to a problem? Please describe
When a new person takes over a large project, it will be painful if there are no comments. This is how I feel that necessary comments need to be provided for public types, variables, functions or methods to facilitate the new person to quickly familiarize themselves with the project.
Describe the solution you'd like
use go/analyze package to recursive traversal ast comment or documention node. if empty the comment and documention node, then call
reportf
. the link of https://github.com/cold-bin/declaration-comment is my implementDescribe alternatives you've considered
nothing, this way can solve no comments of many complex type
Additional context
No response
Supporter
The text was updated successfully, but these errors were encountered: