script/fmt calls goimports, which nothing installs — make fmt fails on a fresh clone #29

Closed
opened 2026-09-05 03:36:39 +02:00 by clawbot · 1 comment
Collaborator

Found by the phase-2 worker on PR #28 and deliberately left out of scope there, correctly: it is outside issue #27's definition of done, and widening a green PR to absorb an unrelated fix is how a reviewable change becomes an unreviewable one.

Problem

script/fmt invokes goimports. Nothing in the repo installs it:

  • script/bootstrap does not install it.
  • It is absent from the lint image.

So make fmt fails on a fresh clone. A new contributor's first encounter with the repo's own formatting entrypoint is a command not found.

Why this is not urgent, and why it should still be fixed

script/fmt is a write-mode developer convenience. It is not on the make check or container path, so it does not affect the CI gate — docker build . is green regardless, and the PR #28 verification stands. The read-only counterpart script/fmt-check uses gofmt -l ., which ships with the toolchain and works fine.

The defect is that a documented standard STRTA entrypoint is broken out of the box. Under the STRTA scaffold (issue #16) make fmt is one of the nine standard targets, so "it happens to be unused" is not a defence.

Definition of done

  • make fmt succeeds on a genuinely fresh clone. Verify by cloning to a new directory, not by running it in a tree where the tool is already on $PATH — that is the whole bug.
  • Either script/bootstrap installs goimports at a pinned version, or script/fmt stops depending on it. Both are defensible; pick one deliberately and say why in the PR.
  • If goimports stays, its formatting must not disagree with what script/fmt-check enforces via gofmt -l .. A fmt target that writes changes a fmt-check target then rejects would be worse than the current failure, because it would be silent.
  • make check stays green, and the container build stays green.

Implementation requirements

  • Do NOT modify .golangci.yml — standardized, owner-only.
  • Every FROM stays digest-pinned.
  • Sequence after PR #28 lands; it touches script/check and the Dockerfile, and whichever lands later must not revert the other.
  • Coordinate with issue #20, which moves linting into Dockerfile.lint and removes golangci-lint installation from script/bootstrap — if bootstrap is where goimports ends up, these two issues disagree about what bootstrap is for. Resolve that rather than landing both blindly.
  • Landing commit title must end with (closes #<this issue>), bare, not a markdown link — Gitea's auto-close only matches the bare form.
Found by the phase-2 worker on [PR #28](https://git.eeqj.de/sneak/simplelog/pulls/28) and deliberately left out of scope there, correctly: it is outside [issue #27](https://git.eeqj.de/sneak/simplelog/issues/27)'s definition of done, and widening a green PR to absorb an unrelated fix is how a reviewable change becomes an unreviewable one. ## Problem `script/fmt` invokes `goimports`. Nothing in the repo installs it: - `script/bootstrap` does not install it. - It is absent from the lint image. So `make fmt` fails on a fresh clone. A new contributor's first encounter with the repo's own formatting entrypoint is a `command not found`. ## Why this is not urgent, and why it should still be fixed `script/fmt` is a write-mode developer convenience. It is **not** on the `make check` or container path, so it does not affect the CI gate — `docker build .` is green regardless, and the [PR #28](https://git.eeqj.de/sneak/simplelog/pulls/28) verification stands. The read-only counterpart `script/fmt-check` uses `gofmt -l .`, which ships with the toolchain and works fine. The defect is that a documented standard STRTA entrypoint is broken out of the box. Under the STRTA scaffold ([issue #16](https://git.eeqj.de/sneak/simplelog/issues/16)) `make fmt` is one of the nine standard targets, so "it happens to be unused" is not a defence. ## Definition of done - `make fmt` succeeds on a genuinely fresh clone. Verify by cloning to a new directory, not by running it in a tree where the tool is already on `$PATH` — that is the whole bug. - Either `script/bootstrap` installs `goimports` at a pinned version, or `script/fmt` stops depending on it. Both are defensible; pick one deliberately and say why in the PR. - If `goimports` stays, its formatting must not disagree with what `script/fmt-check` enforces via `gofmt -l .`. A `fmt` target that writes changes a `fmt-check` target then rejects would be worse than the current failure, because it would be silent. - `make check` stays green, and the container build stays green. ## Implementation requirements - Do NOT modify `.golangci.yml` — standardized, owner-only. - Every `FROM` stays digest-pinned. - Sequence after [PR #28](https://git.eeqj.de/sneak/simplelog/pulls/28) lands; it touches `script/check` and the `Dockerfile`, and whichever lands later must not revert the other. - Coordinate with [issue #20](https://git.eeqj.de/sneak/simplelog/issues/20), which moves linting into `Dockerfile.lint` and removes golangci-lint installation from `script/bootstrap` — if bootstrap is where `goimports` ends up, these two issues disagree about what bootstrap is for. Resolve that rather than landing both blindly. - Landing commit title must end with ` (closes #<this issue>)`, bare, not a markdown link — Gitea's auto-close only matches the bare form.
Author
Collaborator

Closed at sneak's instruction, 2026-09-05: this was opened by an agent running on another machine outside the managed fleet, under superseded rules. Reopen if the content is wanted.

Model: fable-5-1

Closed at sneak's instruction, 2026-09-05: this was opened by an agent running on another machine outside the managed fleet, under superseded rules. Reopen if the content is wanted. Model: fable-5-1
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/simplelog#29