You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor: improve code readability by removing unnecessary parentheses - #5684
My change requires a documentation update, and I have done it.
I have added tests to cover my changes.
I have added or updated fuzz targets for any code handling untrusted input.
I have filled out the description and linked the related issues.
Description
Problem
Running make format changed ~60 files, mostly by shuffling imports. Two reasons:
Broken gci command. The Makefile used $(go list -m), which Make treats as an (empty) Make variable, not a shell command. So gci got -local <first file path> instead of the module name. It treated our own github.com/ethersphere/bee/v2 imports as third-party and merged them with everything else.
Unpinned tools.gofumpt@latest meant every developer could get a different version and different output.
Changes
Makefile
make format now runs only gofumpt. It no longer reorders imports.
New optional make format-imports target, with a corrected gci command (gci write -s standard -s default -s "prefix(<module>)").
akrem-chabchoub
changed the title
chore: update formatting commands and dependencies in Makefile and documentation
chore: update formatting commands and dependencies in Makefile
Nov 4, 2026
Not sure if we need to run make format-imports, that wil generate +300 file changes for just imports re-ordering !
akrem-chabchoub
changed the title
chore: update formatting commands and dependencies in Makefile
refactor: improve code readability by removing unnecessary parentheses
Nov 4, 2026
make format runs gofumpt on *.pb.go and splits their imports into two groups. make protobuf regenerates them as one group, so the two targets keep rewriting the same imports. format-imports already skips *.pb.go; gofumpt should too.
make format runs gofumpt on *.pb.go and splits their imports into two groups. make protobuf regenerates them as one group, so the two targets keep rewriting the same imports. format-imports already skips *.pb.go; gofumpt should too.
@sbackend123 Not sure I understood correctly. *.pb.go files have the // Code generated … DO NOT EDIT. header, and gofumpt skips those when it formats a folder (it only touches them if you pass the file directly). When I run make format on this branch, no .pb.go files change.
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
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.
Checklist
Description
Problem
Running
make formatchanged ~60 files, mostly by shuffling imports. Two reasons:gcicommand. The Makefile used$(go list -m), which Make treats as an (empty) Make variable, not a shell command. Sogcigot-local <first file path>instead of the module name. It treated our owngithub.com/ethersphere/bee/v2imports as third-party and merged them with everything else.gofumpt@latestmeant every developer could get a different version and different output.Changes
Makefile
make formatnow runs onlygofumpt. It no longer reorders imports.make format-importstarget, with a correctedgcicommand (gci write -s standard -s default -s "prefix(<module>)").GOFUMPT_VERSION ?= v0.11.0,GCI_VERSION ?= v0.14.0.install-formattersnow usesgo installinstead ofgo get, so it no longer modifiesgo.mod.Docs
AGENTS.mdandCODINGSTYLE.mdnow describe the newmake format/make format-importsbehavior.Code (output of
make format, 13 files)if (len(args)) != 1→if len(args) != 1,*(headers.LookaheadBufferSize)→*headers.LookaheadBufferSize,&(pruneImpl)→&pruneImpl.var x = …→x := …(safe_test.go), a stray blank line (status_test.go), blank lines between one-line funcs (snapshot_test.go).No behavior changes. All edits are formatting only.
Open API Spec Version Changes (if applicable)
Motivation and Context (Optional)
Related Issue (Optional)
Screenshots (if appropriate):
AI Disclosure