Skip to content

Conversation

zyfy29
Copy link
Contributor

@zyfy29 zyfy29 commented Aug 16, 2025

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

@Copilot Copilot AI review requested due to automatic review settings August 16, 2025 13:15
Copy link

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

Copy link
Collaborator

@gmlewis gmlewis left a 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!

Copy link
Contributor

@stevehipwell stevehipwell left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines 25 to 26
// 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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// 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:

image

With empty line:

image

Comment on lines 48 to 49
// 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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// 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

Comment on lines 71 to 72
// 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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// 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

Copy link
Contributor Author

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!

@zyfy29 zyfy29 requested a review from alexandear August 18, 2025 11:52
Copy link

codecov bot commented Aug 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.07%. Comparing base (69dc04b) to head (af88e93).
⚠️ Report is 2 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gmlewis
Copy link
Collaborator

gmlewis commented Aug 18, 2025

Thank you, @alexandear!
Merging.

@gmlewis gmlewis merged commit 3a062d1 into google:master Aug 18, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make sure exported methods and types are documented by godoc in lint rules
4 participants