Skip to content

Swap the format gate from Prettier to bun fmt #795

Done

Description

@HMarzban

Part of #554. Comes from #655: its adopt rule passed, and the maintainer ruled the swap on 2026-11-14. Related: #649.

Benchmark

Field Value
Metric (1) Files that bun fmt formats differently from Prettier on the tracked-file gate list, exact count. (2) bun run check:ci wall time, median of 5, in seconds. (3) The bun run format step in quality-lint.yml, median of 5 CI runs, in seconds. It is a recorded value, with no gate.
Before From the #655 Measured comment, laptop Mac17,6, Bun 1.4.4, cfac48d87: (1) 0 of 2,541. (2) 90.34 s, range 89.47–92.59 s, n = 5, with the Prettier gate. The gate command alone took 10.61 s, and bun fmt --check took 0.15 s. (3) Not measured yet.
After From the 2026-11-16 Measured comment, b87090be4: (1) 0 of 2,582. (2) 85.54 s, range 85.08–86.30 s, n = 5, against a re-taken before of 97.24 s. The gate command alone: 0.15 s, against a re-taken 10.82 s. (3) Not read yet.
Condition The #655 laptop and method: a clean clone of the swap commit, n = 5 after one discarded warm-up, the 1-minute load average under 6 at each start.
Pass rule (1) stays 0 on the swap commit. (2) falls by at least 9.03 s, which is 10 % of the 90.34 s before. The positive control still matches Prettier byte for byte, including the Tailwind class sort.
Rollback Revert the one swap commit. Prettier stays installed until a later change removes it.
Owner Agent in the repo: Steps 1 to 4 and the Measured comment. The maintainer pushes.
Claim "The docs.plus format check fell from 10.61 s to s on one laptop (median of 5)."

Steps

  1. Re-take (1) on the current main before the change. Benchmark bun fmt against Prettier #655 measured cfac48d87, and files have changed since.
  2. Change the 3 call sites in one commit, as Benchmark bun fmt against Prettier #655 §If adopted later says:
    • the format and format:fix scripts in the root package.json
    • the prettier --write entries in .lintstagedrc.js
    • the format gate in scripts/check-ci.ts (the format section, from line 166)
    • quality-lint.yml calls bun run format, so the script change covers it.
  3. Keep prettier and prettier-plugin-tailwindcss installed in this change.
  4. Post a Measured comment with (1) and (2) from the laptop. Post (3) after 5 CI runs. Record it with no gate. Also time lint-staged on one staged change, because Benchmark bun fmt against Prettier #655 did not measure it.

Status (2026-11-16)

Steps 1 to 3 are done (b87090be4), and the pass rule is met. The docs follow-up is 0cc62066a. Left:

  • Post (3), as a recorded value. Then close.
  • The maintainer rules once on the Prettier lines in CLAUDE.md:82 and AGENTS.md:160. Both should name bun fmt now.

Not in v2.3.7: removing prettier and prettier-plugin-tailwindcss, with its call sites. Those are the packages/supabase types script, scripts/check-quickstart-example.ts:69 and :95, and the .vscode Prettier extension entries. It is a separate change with its own risk, and this issue does not need it to close.

Acceptance

  • (1) is 0 on the swap commit, and the positive control matches.
  • The 3 call sites change in one commit.
  • A Measured comment holds (1), (2) and (3), with the pass rule judged.

Activity

  1. added this to the v2.3.7 milestone on Nov 14, 2026
  2. added
    Performance
    on Nov 14, 2026
  3. HMarzban commented on Nov 16, 2026

    @HMarzban
    CollaboratorAuthor

    Measured, 2026-11-16

    Laptop Mac17,6, Bun 1.4.4, 5fc138dad plus the swap diff, now commit b87090be4. The #655 method, in a scratch clone: n = 5 after 1 discarded warm-up, /usr/bin/time -l, the 1-minute load average under 6 at each start.

    Metric Before After Change
    (1) Files bun fmt formats differently 0 of 2,582 0 of 2,582 —
    (2) bun run check:ci 97.24 s, 96.86–99.38 85.54 s, 85.08–86.30 12 % less time
    Gate command alone 10.82 s, 10.73–11.82 0.15 s, 0.14–0.15 98 % less time
    bun run format, laptop 10.22 s, 9.66–10.42 0.13 s, 0.13–0.14 98 % less time
    lint-staged tasks on one .tsx (ESLint, then format) 0.42 s, 0.41–0.44 0.36 s, 0.35–0.36 14 % less time
    • Counted runs started at load 4.49–5.64 (before) and 3.77–5.93 (after). Two before runs started above 6 and were replaced.
    • Every check:ci run printed PASS, with both build:ci gates passing and the extension matrix at "none".
    • The gate list has 3,158 files: 220 ignored, 356 with no parser, 2,582 in scope. bun fmt selects the same 2,582. The doctor sends 0 files to Prettier.
    • Positive control: 6 seeded files. Both tools list the same 6 and exit 1. Every output matches byte for byte, including the Tailwind sort.
    • lint-staged itself was not timed, because it re-stages with git add. Only its two tasks were timed. The commits after the swap ran it for real, with bun fmt.

    Pass rule: met. (1) stays 0. (2) fell by 11.70 s, above the 9.03 s line and above 10 % of the new before (9.72 s). The positive control matches.

    Claim: "The docs.plus format check fell from 10.82 s to 0.15 s on one laptop (median of 5), 98 % less time."

    Left:

    • (3) the bun run format CI step, median of 5 runs, after the push. Agent reads the runs.
    • CONTRIBUTING.md:404-405 and packages/eslint-config/README.md:65 still say Prettier. Agent, in a follow-up change.
    • Remove prettier and prettier-plugin-tailwindcss after (3). Agent, in a later change. packages/supabase types still calls bunx prettier.
  4. HMarzban commented on Nov 16, 2026

    @HMarzban
    CollaboratorAuthor

    Measured, 2026-11-16

    Docs follow-up, commit 0cc62066a.

    Docs follow-up from the Left list. This is a docs-only change, so nothing was timed.

    • CONTRIBUTING.md: the Formatting section, the pre-commit line, and the check:fix, format and format:fix rows now name bun fmt.
    • packages/eslint-config/README.md: check now lists bun fmt --check, and check:push says it skips it. The feature row now names eslint-config-prettier, the package index.js imports.
    • .prettierignore:19 comment now names bun fmt.
    • The new text says bun fmt reads .prettierrc.json. I checked this. bun fmt --find-config-path finds the config through the root package.json. A stdin probe applied singleQuote and semi: false from that file.
    • bun fmt --check on the touched files exits 0. bun run check:agent-docs exits 0.

    Left:

    • (3) the bun run format CI step, median of 5 runs, after the push. Agent reads the runs.
    • .cursor/docs/scripts-naming-convention.md:171, :177 and :313 still say Prettier. This file needs a maintainer ruling. Owner: maintainer, then an agent makes the edit.
    • Agent rule files still say Prettier: AGENTS.md:160 lists 'Prettier' as a gate, and CLAUDE.md:82 says Prettier checks the house skills. Owner: agent, after the maintainer agrees to edit those files.
    • Code still calls Prettier: the packages/supabase types script, and scripts/check-quickstart-example.ts:69 and :95. Owner: agent, in the later change that removes prettier and prettier-plugin-tailwindcss.
    • .vscode/README.md and .vscode/extensions.json still name the Prettier editor extension. That is still true. Owner: agent, in the same removal change.
  5. HMarzban commented on Nov 16, 2026

    @HMarzban
    CollaboratorAuthor

    Review, 2026-11-16 (maintainer approved).

    • Metric (3), the CI step median, is now a recorded value with no gate. The pass rule never used it.
    • The Prettier package removal and its call sites now sit under a "Not in v2.3.7" line. It is a separate change with its own risk. No new issue is filed.
    • The After row holds the laptop values from the 2026-11-16 Measured comment. Acceptance boxes 1 and 2 are ticked.
    • One maintainer ruling is asked for: change the Prettier lines in CLAUDE.md:82 and AGENTS.md:160 to bun fmt.
    • What closes this issue: post (3) after 5 CI runs.
  6. HMarzban commented on Nov 24, 2026

    @HMarzban
    CollaboratorAuthor

    Measured, 2026-11-24: metric (3) CI bun fmt --check . duration

    Question. How long does bun fmt --check . take in CI across 5 clean runs after b87090be4?

    Setup. GitHub-hosted ubuntu-latest runner, workflow prod.docs.plus.yml, job lint / 🔍 Lint & Format, step 🔍 Lint, format & styles (shared across quality-lint.yml).

    Method. Read the exact ISO timestamps of $ bun fmt --check . and All matched files use Prettier code style! from the job logs (n = 5 on Bun 1.4.4; $ stylelint starts 6 to 8 ms later).

    Result.

    Run Commit Bun Start -> stdout match (UTC) bun fmt duration (s)
    43876524495 06f61ee44 1.4.4 13:32:01.667Z -> 13:32:02.141Z 0.47
    43931900751 dcd69569b 1.4.4 18:44:39.699Z -> 18:44:39.987Z 0.29
    43939117880 5aa56e1d1 1.4.4 19:26:00.564Z -> 19:26:00.931Z 0.37
    44025904215 28037ba77 1.4.4 05:42:49.738Z -> 05:42:50.199Z 0.46
    44041325574 afd06574b 1.4.4 07:47:30.724Z -> 07:47:31.091Z 0.37
    • Metric (3), Bun 1.4.4 (n = 5): median 0.37 s, range 0.29 to 0.47 s.
    • Later context: 45132328837 (e4d36ae0f, Bun 1.4.5) took 0.29 s (07:37:17.142Z -> 07:37:17.427Z).
    • Not measured: CI before timing of prettier --check inside the combined step (not logged separately).

    Verdict: Keep. Metrics (1), (2), and (3) are recorded, and the pass rule is met. Updating Prettier lines in CLAUDE.md:82, AGENTS.md:160, and .cursor/docs/scripts-naming-convention.md stays a separate docs cleanup.

    Closing #795 now. No action needed.

  7. added a commit that references this issue on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DevOpsPerformance

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions