chore: enable Go code formatters: gci and gofumpt#2061
Open
alexandear wants to merge 1 commit intogithub:mainfrom
Open
chore: enable Go code formatters: gci and gofumpt#2061alexandear wants to merge 1 commit intogithub:mainfrom
alexandear wants to merge 1 commit intogithub:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enables two Go code formatters (gci and gofumpt) in the golangci-lint configuration to enforce consistent code formatting across the codebase. The formatters organize imports into standardized sections and apply stricter formatting rules than the default gofmt.
Changes:
- Updated
.golangci.ymlto enablegci(import organizer) andgofumpt(stricter gofmt) formatters with appropriate configuration - Applied automated formatting changes across 65+ Go files to comply with the new formatter rules, including import reorganization, octal literal notation, variable/type declaration grouping, and minor whitespace adjustments
Reviewed changes
Copilot reviewed 80 out of 80 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
.golangci.yml |
Added formatters section enabling gci and gofumpt with gci configured for 3-section import organization (standard, default, localmodule) |
pkg/utils/api.go |
Removed unnecessary blank line |
pkg/translations/translations.go |
Changed var declaration from explicit to short form (:=) |
pkg/scopes/fetcher_test.go |
Added blank lines between interface method implementations |
pkg/sanitize/sanitize_test.go |
Added blank line between test functions |
pkg/sanitize/sanitize.go |
Grouped var declarations with parentheses |
pkg/log/io_test.go |
Reorganized imports into standard/external/local sections |
pkg/log/io.go |
Removed blank line after import statement |
pkg/lockdown/lockdown_test.go |
Reorganized imports into sections |
pkg/inventory/server_tool.go |
Reorganized imports into sections |
pkg/inventory/registry_test.go |
Added blank line between test functions |
pkg/inventory/builder.go |
Ungrouped single var declaration from var block |
pkg/http/transport/graphql_features_test.go |
Reorganized imports into sections |
pkg/http/server.go |
Reorganized imports and changed octal file permissions to 0o600 notation |
pkg/http/oauth/oauth_test.go |
Reorganized imports into sections |
pkg/http/oauth/oauth.go |
Reorganized imports into sections |
pkg/http/middleware/token_test.go |
Reorganized imports into sections |
pkg/http/middleware/pat_scope_test.go |
Reorganized imports into sections |
pkg/http/middleware/mcp_parse_test.go |
Reorganized imports into sections |
pkg/http/handler_test.go |
Reorganized imports into sections |
pkg/http/handler.go |
Reorganized imports, reformatted function signature, removed blank line |
pkg/github/workflow_prompts.go |
Reorganized imports into sections |
pkg/github/toolset_icons_test.go |
Reorganized imports into sections |
pkg/github/tools_validation_test.go |
Reorganized imports into sections |
pkg/github/tools.go |
Reorganized imports and grouped type declarations with parentheses |
pkg/github/server_test.go |
Reorganized imports into sections |
pkg/github/server.go |
Reorganized imports into sections |
pkg/github/security_advisories_test.go |
Reorganized imports into sections |
pkg/github/security_advisories.go |
Reorganized imports into sections |
pkg/github/secret_scanning_test.go |
Reorganized imports and removed blank line |
pkg/github/secret_scanning.go |
Reorganized imports into sections |
pkg/github/search_utils.go |
Reorganized imports into sections |
pkg/github/search_test.go |
Reorganized imports and removed blank line |
pkg/github/search.go |
Reorganized imports into sections |
pkg/github/scope_filter_test.go |
Reorganized imports into sections |
pkg/github/repository_resource_test.go |
Reorganized imports and reformatted test struct fields |
pkg/github/repository_resource.go |
Reorganized imports and removed blank line |
pkg/github/repositories_test.go |
Reorganized imports and added blank line between test functions |
pkg/github/repositories_helper.go |
Reorganized imports into sections |
pkg/github/repositories.go |
Reorganized imports into sections |
pkg/github/pullrequests_test.go |
Reorganized imports and removed blank line |
pkg/github/projects_test.go |
Reorganized imports into sections |
pkg/github/projects.go |
Reorganized imports into sections |
pkg/github/params_test.go |
Added blank line between test functions |
pkg/github/notifications_test.go |
Reorganized imports into sections |
pkg/github/notifications.go |
Reorganized imports into sections |
pkg/github/labels_test.go |
Reorganized imports into sections |
pkg/github/labels.go |
Reorganized imports into sections |
pkg/github/issues_test.go |
Reorganized imports, grouped var declarations, and removed blank line |
pkg/github/issues.go |
Reorganized imports and removed blank lines |
pkg/github/git_test.go |
Reorganized imports into sections |
pkg/github/git.go |
Reorganized imports into sections |
pkg/github/gists_test.go |
Reorganized imports into sections |
pkg/github/gists.go |
Reorganized imports into sections |
pkg/github/feature_flags_test.go |
Reorganized imports and removed blank line |
pkg/github/dynamic_tools_test.go |
Reorganized imports into sections |
pkg/github/dynamic_tools.go |
Reorganized imports into sections |
pkg/github/discussions_test.go |
Reorganized imports into sections |
pkg/github/discussions.go |
Reorganized imports into sections |
pkg/github/dependencies_test.go |
Reorganized imports into sections |
pkg/github/dependencies.go |
Reorganized imports into sections |
pkg/github/dependabot_test.go |
Reorganized imports into sections |
pkg/github/dependabot.go |
Reorganized imports into sections |
pkg/github/copilot_test.go |
Reorganized imports, changed var to := form, and removed blank line |
pkg/github/copilot.go |
Reorganized imports into sections |
pkg/github/context_tools_test.go |
Reorganized imports into sections |
pkg/github/context_tools.go |
Reorganized imports into sections |
pkg/github/code_scanning_test.go |
Reorganized imports and removed blank line |
pkg/github/code_scanning.go |
Reorganized imports into sections |
pkg/github/actions_test.go |
Reorganized imports into sections |
pkg/github/actions.go |
Reorganized imports into sections |
pkg/errors/error.go |
Reorganized imports and grouped type declarations with parentheses |
internal/toolsnaps/toolsnaps_test.go |
Changed octal file permissions to 0o600/0o700 notation |
internal/toolsnaps/toolsnaps.go |
Changed octal file permissions to 0o600/0o700 notation |
internal/profiler/profiler.go |
Reorganized imports (moved log/slog and math to correct position) |
internal/ghmcp/server.go |
Reorganized imports and changed octal file permissions to 0o600 notation |
e2e/e2e_test.go |
Reorganized imports, changed var to := form, and removed blank line |
cmd/github-mcp-server/main.go |
Reorganized imports and grouped var declarations with parentheses |
cmd/github-mcp-server/list_scopes.go |
Reorganized imports into sections |
cmd/github-mcp-server/generate_docs.go |
Reorganized imports and changed octal file permissions to 0o600 notation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enables Go code formatters
gciandgofumptin the linter configuration to improve code consistency and organization throughout the codebase.Why
Enforcing consistent code formatting improves code readability and maintainability. Adding these formatters ensures imports are organized and code style is uniform across the project.
What changed
.golangci.ymlto enablegciandgofumptformattersgolangci-lint fmt) across 65+ Go files to comply with the new formatter rulesMCP impact
Prompts tested (tool changes only)
N/A
Security / limits
Tool renaming
deprecated_tool_aliases.goLint & tests
./script/lint./script/testDocs