Skip to content

fix(lint): Format pruned suppression budgets with oxfmt - #131989

Merged
vaind merged 1 commit into
masterfrom
ivan/format-pruned-suppressions
Nov 20, 2026
Merged

vaind merged 1 commit into
masterfrom
ivan/format-pruned-suppressions

Conversation

@vaind

@vaind vaind commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

On every frontend pull request, the pre-commit lint workflow runs pnpm run lint:suppressions --prune and the bot commits the result as "apply pre-commit fixes". Since #131758 set oxfmt's objectWrap to collapse, that commit expands every {"count": N} in the three oxlint-suppressions.json files onto three lines, with identical JSON content. The next run's format hook collapses them again and fails, and restoring the files only triggers the bot again (seen on #131502).

The prune serialized budgets with JSON.stringify(_, null, 2). We now pipe each written asset through the oxfmt CLI with --stdin-filepath, so it picks up the same .oxfmtrc.json and ignore patterns as the format hook. Pruning master now leaves the files byte-identical. Excluding the files from oxfmt would also stop the loop, but the next prune would re-expand them and they would become the only unformatted JSON in the repo.

Budget comparisons and the temporary root asset still use the plain JSON.stringify output, because only committed files need the hook's format.

The prune wrote oxlint-suppressions.json with JSON.stringify, which expands every budget onto
three lines. Since oxfmt collapses objects that fit on one line, the format hook rewrote those
files on every prune, and the CI bot committed the expansion back each time. Run the written
assets through oxfmt so prune output already matches the format hook.
@vaind
vaind requested a review from a team as a code owner November 20, 2026 07:13
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 20, 2026
@vaind
vaind requested review from TkDodo and nsdeschenes November 20, 2026 07:25

@ArthurKnaus ArthurKnaus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for fixing this!

@vaind
vaind merged commit 44d8912 into master Nov 20, 2026
76 checks passed
@vaind
vaind deleted the ivan/format-pruned-suppressions branch November 20, 2026 09:08
sentry-junior Bot added a commit that referenced this pull request Nov 20, 2026
Drops the reformatted budgets from the earlier pre-commit fix commit, which
only changed layout. #131989 makes the prune write master's format.
ArthurKnaus added a commit that referenced this pull request Nov 20, 2026
Master now formats pruned budgets with oxfmt (#131989), so the suppression
files match master again and this PR no longer touches them.
sentry-junior Bot added a commit that referenced this pull request Nov 20, 2026
Revert the bot's expanded JSON from the prune step, which fought the
format hook until #131989 landed. The files now match master.

Co-Authored-By: Nicholas Deschenes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants