chore: scope pre-commit formatting to staged files#46
Open
tallyhuhu wants to merge 2 commits intoPolymarket:mainfrom
Open
chore: scope pre-commit formatting to staged files#46tallyhuhu wants to merge 2 commits intoPolymarket:mainfrom
tallyhuhu wants to merge 2 commits intoPolymarket:mainfrom
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9ed1cad. Configure here.
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.

Summary
Scope the pre-commit Biome run to staged source and test files only.
Motivation
The previous hook ran Biome with
--writeacross the fullsrcandteststrees on every commit. This could rewrite unrelated files outside the staged change, leaving noisy working-tree modifications after a focused commit.Changes
git diff --cached --name-only --diff-filter=ACMRsrc/andtests/pnpm exec biome check --writeonly on matching staged filesSafety
This only changes local commit tooling. Runtime client behavior and public APIs are unchanged.
Testing
Note
Low Risk
Only affects local developer tooling and the commit path; no runtime or production code changes, with limited risk of friction from the new partially-staged-file guard.
Overview
Updates the Husky
pre-commithook to run Biome formatting only on staged JS/TS files undersrc/andtests/, and to no-op when no matching files are staged.The hook now blocks commits with partially staged matching files (to avoid formatting divergence), then runs
pnpm exec biome check --writeon the staged file list and re-stages any formatting changes.Reviewed by Cursor Bugbot for commit 2eb3ad6. Bugbot is set up for automated code reviews on this repo. Configure here.