script/fmt writes with gofmt -s and goimports, but script/fmt-check only runs gofmt -l. A file that gofmt -s would simplify, or whose imports goimports would regroup, passes make fmt-check and make check, and then changes the next time someone runs make fmt. The read-only check does not check what the formatter writes. Found while working on #13.
Implementation
script/fmt-check fails when gofmt -s -l . lists a file, or when goimports, at the same pinned commit script/fmt uses, lists one (-l). It prints the files and changes nothing.
Keep it as short as script/fmt, and find goimports the same way script/fmt does since #21 landed: the version script/bootstrap installs, with Go's bin directory put on PATH first.
TODO.md updated in the same change.
Definition of done
A planted import out of goimports order, and separately a planted expression gofmt -s simplifies, each make make fmt-check fail; reverted, it passes.
make check and script/cibuild pass. PR to next, independent review, squash.
Model: opus-5-5
`script/fmt` writes with `gofmt -s` and goimports, but `script/fmt-check` only runs `gofmt -l`. A file that `gofmt -s` would simplify, or whose imports goimports would regroup, passes `make fmt-check` and `make check`, and then changes the next time someone runs `make fmt`. The read-only check does not check what the formatter writes. Found while working on https://git.eeqj.de/sneak/attrsum/issues/13.
## Implementation
- `script/fmt-check` fails when `gofmt -s -l .` lists a file, or when goimports, at the same pinned commit `script/fmt` uses, lists one (`-l`). It prints the files and changes nothing.
- Keep it as short as `script/fmt`, and find goimports the same way `script/fmt` does since https://git.eeqj.de/sneak/attrsum/pulls/21 landed: the version `script/bootstrap` installs, with Go's bin directory put on `PATH` first.
- `TODO.md` updated in the same change.
## Definition of done
- A planted import out of goimports order, and separately a planted expression `gofmt -s` simplifies, each make `make fmt-check` fail; reverted, it passes.
- `make check` and `script/cibuild` pass. PR to `next`, independent review, squash.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
script/fmtwrites withgofmt -sand goimports, butscript/fmt-checkonly runsgofmt -l. A file thatgofmt -swould simplify, or whose imports goimports would regroup, passesmake fmt-checkandmake check, and then changes the next time someone runsmake fmt. The read-only check does not check what the formatter writes. Found while working on #13.Implementation
script/fmt-checkfails whengofmt -s -l .lists a file, or when goimports, at the same pinned commitscript/fmtuses, lists one (-l). It prints the files and changes nothing.script/fmt, and find goimports the same wayscript/fmtdoes since #21 landed: the versionscript/bootstrapinstalls, with Go's bin directory put onPATHfirst.TODO.mdupdated in the same change.Definition of done
gofmt -ssimplifies, each makemake fmt-checkfail; reverted, it passes.make checkandscript/cibuildpass. PR tonext, independent review, squash.Model: opus-5-5