Skip to content

Conversation

@cyphar
Copy link
Member

@cyphar cyphar commented Sep 30, 2025

This silences all of the "should have a package comment" lint warnings
from golangci-lint.

Signed-off-by: Aleksa Sarai [email protected]

@cyphar
Copy link
Member Author

cyphar commented Sep 30, 2025

I plan to go through most of the other lint failures when I have time, but this was a fairly easy one to fix.

@lifubang lifubang requested a review from Copilot October 1, 2025 11:39
Copy link

Copilot AI left a 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.

Copy link
Member

@rata rata left a 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

@cyphar cyphar mentioned this pull request Oct 3, 2025
@cyphar cyphar force-pushed the lint-package-comments branch from 7ed5182 to 3b23cd0 Compare October 3, 2025 05:17
This silences all of the "should have a package comment" lint warnings
from golangci-lint.

Signed-off-by: Aleksa Sarai <[email protected]>
@cyphar cyphar force-pushed the lint-package-comments branch from 3b23cd0 to 627054d Compare October 3, 2025 05:17
@kolyshkin
Copy link
Contributor

By the way, there were few attempts at improving the code vs linters that weren't merged:

Comment on lines +1 to 4
// Package userns provides tools for dealing with user namespaces.
//
// Deprecated: use github.com/moby/sys/userns
package userns
Copy link
Contributor

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).

Copy link
Member Author

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.

@cyphar
Copy link
Member Author

cyphar commented Oct 3, 2025

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...

Copy link
Contributor

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

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

lgtm

@cyphar cyphar merged commit 984b353 into opencontainers:main Oct 3, 2025
36 checks passed
@cyphar cyphar deleted the lint-package-comments branch October 3, 2025 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants