Skip to content

chore: Remove duplicated formatters#4094

Merged
gmlewis merged 1 commit intogoogle:masterfrom
alexandear-org:chore/remove-gofmt-goimports
Mar 13, 2026
Merged

chore: Remove duplicated formatters#4094
gmlewis merged 1 commit intogoogle:masterfrom
alexandear-org:chore/remove-gofmt-goimports

Conversation

@alexandear
Copy link
Copy Markdown
Contributor

The formatters gofmt and goimports can be removed because we have more powerful gofumpt and gci.

Updates #4070

@stevehipwell
Copy link
Copy Markdown
Contributor

@alexandear do we have a need for gci, and if not is there a reason to pick it over goimports? The main reason I ask is because we have a single non-stdlib import in the non-test code and there are only 2 in the main codebase; so it doesn't seem like this is an area we need much power?

@alexandear
Copy link
Copy Markdown
Contributor Author

@alexandear do we have a need for gci, and if not is there a reason to pick it over goimports? The main reason I ask is because we have a single non-stdlib import in the non-test code and there are only 2 in the main codebase; so it doesn't seem like this is an area we need much power?

Yes, we do.

goimports allows the following:

import (
	"fmt"

	"net/http"

	"os"

	"github.com/google/go-github/v84/github"

	"google.golang.org/appengine"

	"google.golang.org/appengine/log"
)

gci does not. It formats to:

import (
	"fmt"
	"net/http"
	"os"

	"github.com/google/go-github/v84/github"
	"google.golang.org/appengine"
	"google.golang.org/appengine/log"
)

You can verify this by running:

./bin/custom-gcl fmt --enable=goimports --no-config

./bin/custom-gcl fmt --enable=gci --no-config

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.67%. Comparing base (fca7973) to head (a96259c).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4094   +/-   ##
=======================================
  Coverage   93.67%   93.67%           
=======================================
  Files         211      211           
  Lines       19478    19478           
=======================================
  Hits        18246    18246           
  Misses       1034     1034           
  Partials      198      198           

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

@stevehipwell
Copy link
Copy Markdown
Contributor

@alexandear fair enough, I was only looking at the core codebase.

Copy link
Copy Markdown
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

Copy link
Copy Markdown
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, @alexandear and @stevehipwell!
LGTM.
Merging.

@gmlewis gmlewis merged commit 39ef794 into google:master Mar 13, 2026
8 checks passed
@alexandear alexandear deleted the chore/remove-gofmt-goimports branch March 13, 2026 16:41
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.

3 participants