chore: make lint and format validation commands non-mutating - #1463
chore: make lint and format validation commands non-mutating#1463Chirag6722 wants to merge 1 commit into
Conversation
`format-lint` and the web app's `lint` both ran `biome check --write`, so the commands CONTRIBUTING points at as pre-PR validation rewrote the working tree instead of reporting on it. Drop `--write` from both and move the auto-fixing behaviour to explicit `format-lint:fix` / `lint:fix` scripts. CONTRIBUTING and CLAUDE.md are updated to name the read-only commands, and the auto-fix CI workflow now invokes `format-lint:fix`, since it relies on the fixes actually being applied. Fixes supermemoryai#1448
Review (manual verification)Reviewed the diff against a fresh checkout of Core change — verified
The workflow update is functionally necessary
One gap worth a follow-upThe current codebase has 652 pre-existing Biome errors (mostly formatter output on
Root causes I found:
Suggest a follow-up that either excludes config files from Biome formatting or formats-and-commits them once, so the documented |
|
Thanks for digging into this properly — and the On the count, though, I get a very different number. Measured on a pristine worktree of and I think 652 is a line-endings artifact rather than a real property of the repo. On Windows with git's default git -c core.autocrlf=input worktree add ../sm-clean origin/main --detach
bunx biome check ../sm-cleanSo I'd frame the follow-up as narrower than you suggested: bump the pinned Either way, this PR doesn't change the exit code on |
Fixes #1448.
format-lint(root) andlint(apps/web) both ranbiome check --write. CONTRIBUTING points atbun run format-lintas a pre-PR validation step, but running it rewrites your working tree — surprising locally, and unusable as a check in CI.Change
format-lintbiome check --writebiome checkformat-lint:fixbiome check --writeapps/weblintbiome check --writebiome checkapps/weblint:fixbiome check --writeDocs updated to match in
CONTRIBUTING.mdandCLAUDE.md.One non-obvious follow-on:
.github/workflows/claude-auto-fix-ci.ymlinstructs the auto-fix bot to runbun run format-lintto repair lint failures. That only worked because of the--write, so it now points atformat-lint:fix— otherwise this change would have silently broken the auto-fix job.Acceptance criteria
git statusunchanged — verified for bothbun run format-lintandapps/web'sbun run lint; tree byte-identical before and after.:fixcommands apply fixes —format-lint:fix/lint:fixretain--write.Note on the exit code
bun run format-lintexits 1 on currentmain— but so doesbiome check --writetoday, so this PR doesn't change that. There are 3 pre-existing errors, two of which are deserialization failures in the nestedapps/web/biome.jsonandpackages/ui/biome.json:Both pin
$schematohttps://biomejs.dev/schemas/2.2.2/schema.jsonwhile the workspace resolves@biomejs/biomeat^2.2.0to a newer release. It doesn't surface in CI becausebiome ci --changedonly ever inspects files touched by a PR. Left alone here to keep this PR to one concern — happy to open a separate one if you want it fixed.