Skip to content

chore(git): format staged files in the commit hook - #88

Merged
RJiazhen merged 1 commit into
mainfrom
chore/format-hook-ci
Oct 19, 2026
Merged

RJiazhen merged 1 commit into
mainfrom
chore/format-hook-ci

Conversation

@RJiazhen

@RJiazhen RJiazhen commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • The commit hook ran the whole vp check --fix, which included type checks already covered by CI.
  • staged now runs ["vp fmt --write", "vp lint --fix"] on staged files, so they are formatted and lint-fixed (and re-staged) before the commit lands.
  • CI is unchanged: the existing check job still runs vp check, so formatting keeps being verified there.

Test plan

  • pnpm exec vp fmt --check fails (exit 1) on an unformatted staged file
  • pnpm exec vp staged / .vite-hooks/pre-commit reformats staged files and updates the index
  • pnpm exec vp fmt --check passes on the whole repo
  • CI check passes on this PR

No protocol src changes, so no protocol pack or extension F5 needed.

The commit hook previously ran the whole `vp check`, so a commit paid for
type checks that CI already covers. Run the formatter and lint fixers on
staged files instead, which rewrites and re-stages them before the commit.
@RJiazhen
RJiazhen force-pushed the chore/format-hook-ci branch from 2846288 to 09a45ed Compare October 19, 2026 05:06
@RJiazhen RJiazhen changed the title chore(ci): format staged files on commit and check format in CI chore(git): format staged files in the commit hook Oct 19, 2026
@RJiazhen
RJiazhen merged commit f58991b into main Oct 19, 2026
1 check passed
@RJiazhen
RJiazhen deleted the chore/format-hook-ci branch October 19, 2026 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant