style: gofmt six drifted files - #329
Conversation
`gofmt -l .` flagged six files: struct-tag and trailing-comment alignment, a cobra field block, one doubled blank line, and one trailing blank line at EOF. Whitespace only — each file is byte-identical to its previous version once all whitespace is stripped. Nothing enforces this today: the golangci-lint v2 config has no `formatters` section and no workflow runs gofmt, so the drift accumulated silently. Adding a gate is left as a separate call. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
There was a problem hiding this comment.
Pull request overview
This PR applies gofmt to six previously drifted Go files, bringing formatting back in sync with standard Go tooling without changing behavior or semantics.
Changes:
- Reformatted composite literals and struct tag alignment in several tests to match
gofmtoutput. - Normalized spacing/alignment in a Cobra command definition block.
- Removed extraneous blank lines (including an EOF trailing blank line).
Reviewed changes
Copilot reviewed 2 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/cmd/memory/member.go | gofmt alignment updates in a cobra.Command literal. |
| internal/cmd/node_import_content_cmd_test.go | gofmt alignment for struct field + tag formatting in test helper types. |
| internal/cmdutil/memref_test.go | gofmt alignment in a map literal’s trailing comments. |
| internal/nodedoc/markdown_test.go | gofmt alignment in a slice literal’s trailing comments. |
| internal/cmd/access_cmd_test.go | Removes an extra blank line between tests/comments. |
| internal/cmd/node/export.go | Removes trailing blank line at EOF. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Nothing enforced formatting before this: .golangci.yml had no `formatters` section and no workflow ran gofmt, so six files drifted unnoticed until #329. This closes the loop so it can't recur silently. Enabling the gofmt formatter means `golangci-lint run` reports a formatting diff as an issue and exits non-zero — which gates both `make lint` locally and the CI lint job (golangci-lint-action runs `run` by default), so no workflow change is needed. Generated code is excluded via `exclusions.generated: strict`: genqlient's output carries the standard "Code generated by … DO NOT EDIT." header, and a formatting complaint there isn't hand-fixable since `make generate` rewrites the file. Verified — drift injected into internal/api/gen/generated.go is seen by `gofmt -l` but correctly ignored by the linter. `make fmt` (golangci-lint fmt) applies the fixes, so a failing gate has an obvious remedy. Verified end to end: clean tree passes; injected drift fails `make lint`; `make fmt` repairs it byte-for-byte; `make lint` passes again. Co-authored-by: Holger Selover-Stephan <holger@baragaun.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
gofmt -l .flagged six files onmain. Runninggofmt -wover them; whitespace only.Follow-up to #328, where a blanket
gofmt -w internal/cmd/incidentally touched four of these. I reverted them there to keep that PR to one change — this is the separate cleanup, and it turned out to be six files rather than four (my earlier scan only coveredinternal/cmd).What changed
internal/cmd/memory/member.goUse:stringinternal/cmd/node_import_content_cmd_test.gointernal/cmdutil/memref_test.gointernal/nodedoc/markdown_test.gointernal/cmd/access_cmd_test.gointernal/cmd/node/export.goVerification
Each file is byte-identical to its previous version once all whitespace is stripped:
gofmt -l .is now empty.go test ./...— 16 packages green.make lint— 0 issues.Why it drifted
Nothing enforces
gofmtin this repo:.golangci.ymlis golangci-lint v2 withlinters.default: standardand noformatterssection, and no workflow shells out togofmt. So formatting drift is invisible to CI and accumulates.Adding a gate — a
formatters: enable: [gofmt]block in.golangci.yml, or agofmt -lstep in the lint workflow — would stop it recurring. I've left that out of this PR since it changes CI behaviour; happy to open it separately if you want it.🤖 Generated with Claude Code