-
Notifications
You must be signed in to change notification settings - Fork 2.2k
lint/revive: add package doc comments #4904
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
Conversation
|
I plan to go through most of the other lint failures when I have time, but this was a fairly easy one to fix. |
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.
Pull Request Overview
This PR adds package documentation comments to silence "should have a package comment" lint warnings from golangci-lint's revive linter. The changes ensure all Go packages have proper documentation as required by Go best practices.
- Adds package comments to 25+ packages across the codebase
- Moves existing comment from function level to package level in one case
- Creates new doc.go files for packages that didn't have existing Go files
Reviewed Changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| types/events.go | Adds package comment describing cgroup-related events APIs |
| tests/cmd/*/*.go | Adds package comments for various test command utilities |
| main.go | Adds package comment for the main runc command-line implementation |
| libcontainer/*/*.go | Adds package comments for various libcontainer subpackages |
| internal/linux/doc.go | Creates new doc.go with package comment for Linux system call wrappers |
| contrib/cmd/memfd-bind/memfd-bind.go | Adds package comment with deprecation notice |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
rata
left a comment
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.
Thanks! This mostly LGTM, left a question about doc for main packages
7ed5182 to
3b23cd0
Compare
This silences all of the "should have a package comment" lint warnings from golangci-lint. Signed-off-by: Aleksa Sarai <[email protected]>
3b23cd0 to
627054d
Compare
|
By the way, there were few attempts at improving the code vs linters that weren't merged:
|
| // Package userns provides tools for dealing with user namespaces. | ||
| // | ||
| // Deprecated: use github.com/moby/sys/userns | ||
| package userns |
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.
This package was deprecated in v1.2, maybe it's time to remove it (for v1.4).
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.
I'll open a separate PR for it.
|
I can try to take a shot at it again when I have some time. Maybe it'd be best to just do one linter per PR to reduce the review overhead for each PR... |
kolyshkin
left a comment
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
This silences all of the "should have a package comment" lint warnings
from golangci-lint.
Signed-off-by: Aleksa Sarai [email protected]