Skip to content

Commit d523e23

Browse files
committed
Tooling: Stage oxfmt auto-fixes in the release commit
Until now, `scripts/release.sh` ran `oxfmt` (auto-fix) and then `git add`-ed a hard-coded list of version-bumped files. Anything else `oxfmt` reformatted (typically a `.claude/commands/*.md` the user touched in the same pre-release batch) was left in the working tree and never made it into the release commit. CI then failed on `oxfmt --ci` for the release tag because the committed tree didn't match the formatted tree the release script saw. `git add -u` after the bump-stage picks up any reformatted tracked files. The pre-flight at the top of the script guarantees the working tree was clean before we started, so the only diffs at this point are the version bumps plus `oxfmt`'s auto-fixes — exactly what we want in the release commit. A second `oxfmt --ci` pass after staging is belt-and-braces: if anything still drifts, abort instead of pushing.
1 parent 4ba3154 commit d523e23

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

scripts/release.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,31 @@ sed -i '' "s/## \[Unreleased\]/## [$VERSION] - $TODAY/" CHANGELOG.md
6565

6666
# Run oxfmt across the repo so CHANGELOG / package.json / tauri.conf.json drift from
6767
# manual edits + the sed/`npm pkg set` mutations above doesn't fail CI on the release commit.
68+
# This also reformats any unrelated files that drifted (for example, a `.claude/commands/*.md`
69+
# touched in the same uncommitted batch the user is releasing).
6870
./scripts/check.sh --check oxfmt
6971

70-
# Commit and tag (only files touched by this script)
72+
# Stage the files the script itself just bumped.
7173
git add \
7274
CHANGELOG.md \
7375
apps/website/src/pages/roadmap.astro \
7476
apps/desktop/package.json \
7577
apps/desktop/src-tauri/tauri.conf.json \
7678
apps/desktop/src-tauri/Cargo.toml \
7779
Cargo.lock
80+
81+
# Pick up anything oxfmt reformatted on top of those. `git add -u` only touches tracked
82+
# files that are already modified, and the pre-flight at the top of this script guaranteed
83+
# the working tree was clean before we started, so the only modifications that exist now
84+
# are the version bumps above plus oxfmt's auto-fixes. This keeps the release commit in
85+
# sync with what oxfmt --ci will see in CI on the freshly-pushed tag.
86+
git add -u
87+
88+
# Belt-and-braces: confirm the staged tree passes oxfmt in CI mode (no auto-fix). If this
89+
# fails, the release commit would land with formatting drift that CI rejects, so abort
90+
# instead of pushing.
91+
./scripts/check.sh --check oxfmt --ci
92+
7893
git commit -m "chore(release): v$VERSION"
7994
git tag "v$VERSION"
8095

0 commit comments

Comments
 (0)