-
Notifications
You must be signed in to change notification settings - Fork 2.2k
chore: Add new lint rule to make sure exported names documented #3682
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
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 a new lint rule to ensure all exported functions, methods, and structs are documented with godoc comments. The change introduces the exported
rule from the revive linter to enforce documentation standards and adds missing godoc comments to existing exported symbols across the codebase.
Key changes:
- Added the
exported
revive lint rule with specific configuration options - Added godoc comments to previously undocumented exported types, functions, and methods
- Reformatted existing deprecation comments to follow proper godoc conventions
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
.golangci.yml | Adds the new exported lint rule configuration with options to disable checks on constants, variables, and stuttering |
tools/sliceofpointers/sliceofpointers.go | Adds godoc comments for exported type and methods |
github/security_advisories.go | Adds godoc comment for SecurityAdvisoriesService |
github/search.go | Adds godoc comment for TopicResult type |
github/repos_tags.go | Reformats deprecation comments to proper godoc format |
github/orgs_audit_log.go | Adds godoc comments for JSON marshaling methods |
github/github.go | Adds godoc comments for Error.UnmarshalJSON method and RateLimitCategory type |
github/git_trees.go | Adds godoc comment for TreeEntry.MarshalJSON method |
github/git_commits.go | Adds godoc comments for MessageSignerFunc.Sign method and CreateCommitOptions type |
github/dependency_graph.go | Adds godoc comment for DependencyGraphService |
github/copilot.go | Adds godoc comment for CopilotSeatDetails.UnmarshalJSON method |
github/apps.go | Adds godoc comment for InstallationTokenListRepoOptions type |
github/actions_workflow_runs.go | Adds godoc comment for ReferencedWorkflow type |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
Thank you, @zyfy29!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
@alexandear or @stevehipwell - might you have time for a code review? Thank you!
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
// ListTagProtection lists tag protection of the specified repository. | ||
// Deprecated: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets |
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.
// ListTagProtection lists tag protection of the specified repository. | |
// Deprecated: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets | |
// ListTagProtection lists tag protection of the specified repository. | |
// | |
// Deprecated: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets | |
There must be an empty line before Deprecated:
to be properly recognized with pkg.go.dev.
Without empty line:

With empty line:

// CreateTagProtection creates the tag protection of the specified repository. | ||
// Deprecated: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset |
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.
// CreateTagProtection creates the tag protection of the specified repository. | |
// Deprecated: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset | |
// CreateTagProtection creates the tag protection of the specified repository. | |
// | |
// Deprecated: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset |
// DeleteTagProtection deletes a tag protection from the specified repository. | ||
// Deprecated: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset |
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.
// DeleteTagProtection deletes a tag protection from the specified repository. | |
// Deprecated: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset | |
// DeleteTagProtection deletes a tag protection from the specified repository. | |
// | |
// Deprecated: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset |
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 fix it, thank you!
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3682 +/- ##
=======================================
Coverage 91.07% 91.07%
=======================================
Files 186 186
Lines 16563 16563
=======================================
Hits 15085 15085
Misses 1293 1293
Partials 185 185 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Thank you, @alexandear! |
close #3666
added a new lint rule by revive to make sure exported functions, methods and structs documented by godoc, and added missing godoc comments for existing names