Skip to content

Comments

chore: enable Go code formatters: gci and gofumpt#2061

Open
alexandear wants to merge 1 commit intogithub:mainfrom
alexandear-org:chore/enable-fmt
Open

chore: enable Go code formatters: gci and gofumpt#2061
alexandear wants to merge 1 commit intogithub:mainfrom
alexandear-org:chore/enable-fmt

Conversation

@alexandear
Copy link
Contributor

Summary

Enables Go code formatters gci and gofumpt in 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

  • Updated .golangci.yml to enable gci and gofumpt formatters
  • Applied formatting changes (run golangci-lint fmt) across 65+ Go files to comply with the new formatter rules

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed
  • New tool added

Prompts tested (tool changes only)

N/A

Security / limits

  • No security or limits impact
  • Auth / permissions considered
  • Data exposure, filtering, or token/size limits considered

Tool renaming

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed
  • Updated (README / docs / examples)

Copilot AI review requested due to automatic review settings February 23, 2026 11:25
@alexandear alexandear requested a review from a team as a code owner February 23, 2026 11:25
Copy link
Contributor

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 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.yml to enable gci (import organizer) and gofumpt (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

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.

1 participant