Repository navigation
chore: format fork-touched files and gate formatting on commit - #261
Merged
Merged
Conversation
Ran prettier --write over every file this fork adds or modifies relative to upstream v1.18.4 (the tag in packages/opencode/package.json). 67 files were unformatted; the rest were already clean. The formatting drift is entirely fork-authored: of the 34 modified upstream files in that set, all 34 are prettier-clean at v1.18.4, so this restores upstream's own formatting conventions rather than imposing new ones. That shrinks conflict surface on the next sync instead of adding to it. packages/web/src/content/docs/ is excluded via .prettierignore. It is the upstream docs merge base (packages/web/FORK-DOCS.md) — nothing builds it, and its only job is to surface upstream doc diffs during a sync, so reformatting it is pure conflict surface. Prettier's MDX printer also mangles index.mdx, collapsing the fenced code blocks inside <TabItem> into inline text. No behavior change: bun turbo typecheck passes (33/33) and the touched test files still pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
quickbeard
force-pushed
the
prettier-fork-files
branch
from
August 18, 2026 02:41
d347c0c to
b3df34c
Compare
PR #261 had to clean up 67 files' worth of Prettier drift that accumulated because nothing enforced formatting — the only hook was pre-push, and it runs `bun typecheck` alone. This adds the missing gate so that drift cannot silently reaccumulate. `.husky/pre-commit` (fork-only; upstream ships pre-push only) runs `bunx lint-staged`, and the root manifest's new `lint-staged` block maps every staged path to `prettier --write --ignore-unknown`. lint-staged re-stages what Prettier rewrites, so the commit lands formatted. `--ignore-unknown` skips paths Prettier has no parser for (`bun.lock`, `.husky/*`, binaries) instead of failing the commit, and `.prettierignore` still exempts `DIVERGENCES.md` and the `packages/web/src/content/docs/` merge base. Verified end-to-end with a deliberately unformatted staged file: the hook reformatted it and the resulting commit contained the formatted version. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Two commits: a one-time formatting cleanup, and the hook that stops the drift from coming back.
1.
chore: format fork-touched files with prettierRan
prettier --writeover every file this fork adds or modifies relative to upstreamv1.18.4(the tag inpackages/opencode/package.json). Of the 705 prettier-eligible fork-touched files, 67 were unformatted; the rest were already clean.Why this is safe to do to upstream files. The formatting drift is entirely fork-authored. I extracted the upstream
v1.18.4version of each of the 34 modified-upstream files in the unformatted set and checked them: all 34 are prettier-clean upstream. So this restores upstream's own formatting conventions on regions the fork edited, which shrinks conflict surface on the next sync rather than adding to it. No new divergence is introduced by the formatting itself — these files already diverge; only their whitespace changes.Exclusion:
packages/web/src/content/docs/. Added to.prettierignore, with the reasoning inline and the existing.prettierignorerow inDIVERGENCES.mdextended:packages/web/FORK-DOCS.md). Nothing in this repo builds it; its whole job is to make upstream doc changes surface during a sync. Reformatting it is pure conflict surface for zero user-facing benefit — the published docs live incodev-landing-page.index.mdx, collapsing the fenced code blocks inside<TabItem>into inline text.2.
chore: format staged files with lint-staged on commitThe drift above accumulated because nothing enforced formatting — the only hook was
pre-push, and it runsbun typecheckalone..husky/pre-commit(fork-only; upstream shipspre-pushonly) runsbunx lint-staged.lint-stagedblock mapping every staged path toprettier --write --ignore-unknown, plus thelint-stageddevDependency.--ignore-unknownskips paths Prettier has no parser for (bun.lock,.husky/*, binaries) instead of failing the commit;.prettierignorestill exemptsDIVERGENCES.mdand the docs merge base.DIVERGENCES.mdrows updated for the rootpackage.jsonandbun.lock.Verification
prettier --checkover the full fork-touched set: clean, and a rerun of--writeover the PR's own files is a no-op (idempotent).bun turbo typecheck: 33/33, including via thepre-pushhook.packages/tuiutil/routes tests,packages/opencodeprovider transform: 386 tests).DIVERGENCES.mdpassed through untouched.*em*→_em_only.No behavior change, so no
CHANGELOG.mdentry.🤖 Generated with Claude Code