Commit the formatting, and stop the release from dirtying its own tree - #192
Merged
Conversation
🦋 Changeset detectedLatest commit: bccefed The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Dropping `cargo publish --allow-dirty` (#186) surfaced what the flag had been hiding for who knows how long: error: 1 files in the working directory contain changes that were not yet committed into git: rust/logger/README.md The dirt comes from release.yml's own `Format` step. It runs `pnpm format`, which REWRITES files and then never commits them — so `cargo publish` a few steps later stares at a dirty tree. `--allow-dirty` existed to shrug that off, which meant every published crate silently carried uncommitted reformatting. main is format-drifted across seven files: .claude/settings.json (4-space vs oxfmt's 2), README.md (94 lines), CHANGELOG.md, package.json (devDependencies unsorted, peerDependencies out of position), a Python test, a TS spec, and rust/logger/README.md. Nothing checked: PR checks run oxlint but never a formatter check, and `pnpm format:check` did not exist. Three changes: 1. Commit the formatting. `pnpm format` is now a no-op on main. 2. Add `format:check` (oxfmt + ruff + cargo fmt + gofmt) and run it in PR checks, so this cannot drift again. Verified red by hand-breaking both a markdown file and a TS file. 3. release.yml's `Format` step becomes `Format check` — check, never rewrite. A release pipeline that mutates the tree and discards the result is exactly the thing that made `--allow-dirty` look necessary. Also: `changeset version` writes CHANGELOG.md and package.json, and oxfmt wants both formatted differently, so the version lifecycle now ends with `oxfmt --write CHANGELOG.md package.json`. Without it the very next release PR would land unformatted and break `cargo publish --locked` all over again. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0152bbE1veqfG1SVJdyLCBxC
Needed for its own sake (this changes package.json scripts) and to unstick the release: crates.io, NuGet and the Go tag stalled at 4.5.0 while npm and PyPI reached 4.5.2, and the downstream publish steps only fire when changesets reports it published something — which needs a version bump. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0152bbE1veqfG1SVJdyLCBxC
brentrager
force-pushed
the
fix/format-drift
branch
from
August 20, 2026 18:51
8c245a5 to
bccefed
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What broke
Dropping
cargo publish --allow-dirty(#186) surfaced what the flag had been hiding. The 4.5.2 release published to npm and PyPI, then:crates.io, the Go tag, and NuGet were all skipped.
Where the dirt comes from
release.yml's own
Formatstep. It runspnpm format, which rewrites files and then never commits them — socargo publish, a few steps later, is looking at a dirty tree.--allow-dirtyexisted to shrug that off, which means every crate published from this repo silently carried uncommitted reformatting.And
mainreally is format-drifted, across seven files:.claude/settings.jsonREADME.mdCHANGELOG.mdpackage.jsondevDependenciesunsorted,peerDependenciesout of positionpython/tests/test_otel_correlation.pysrc/Logger.otel.spec.tsrust/logger/README.md*errors*→_errors_Nothing was checking. PR checks run
oxlintbut never a formatter check, andpnpm format:checkdid not exist — despiterelease.ymlhaving had aFormatstep the whole time.Fix
pnpm formatis now a no-op onmain.format:check—oxfmt --check+ruff format --check+cargo fmt --check+gofmt -l— and run it in PR checks so this cannot drift again.release.yml'sFormat→Format check. Check, never rewrite. A release pipeline that mutates the tree and discards the result is precisely what made--allow-dirtylook necessary.The part that would have bitten again next release
changeset versionwritesCHANGELOG.mdandpackage.json, and oxfmt wants both formatted differently from what changesets emits. Without handling that, the very next release PR lands unformatted, itsformat:checkgoes red, andcargo publish --lockedbreaks all over again. So the version lifecycle now ends withoxfmt --write CHANGELOG.md package.json, inside the same command whose outputchangesets/actioncommits:Verification
pnpm format:check→ exit 0 on this branch.rust/logger/README.md, and mangled import spacing insrc/Logger.otel.spec.ts— and confirmed exit 1 both times, then green again afterpnpm format.node scripts/check-versions.mjs→ OK at 4.5.2; vitest 89 passing;go test ./...ok.After this merges
The 4.5.2 release needs finishing: npm and PyPI have it, crates.io / the Go tag / NuGet do not. Merging this makes the tree clean, and re-running the Release workflow will publish the remainder.
🤖 Generated with Claude Code
https://claude.ai/code/session_0152bbE1veqfG1SVJdyLCBxC