Skip to content

refactor(formatter/sort_imports): Wrap every Comment with label#22514

Merged
graphite-app[bot] merged 1 commit into
mainfrom
05-18-refactor_formatter_sort_imports_wrap_every_comments_with_label
May 18, 2026
Merged

refactor(formatter/sort_imports): Wrap every Comment with label#22514
graphite-app[bot] merged 1 commit into
mainfrom
05-18-refactor_formatter_sort_imports_wrap_every_comments_with_label

Conversation

@leaysgur

@leaysgur leaysgur commented May 18, 2026

Copy link
Copy Markdown
Member

Standardize how the sort_imports IR transform identifies comments.

Previously it mixed two strategies:

  • a label (JsLabels::AlignableBlockComment) for multi-line block comments only
  • and a textual prefix check (text.starts_with("//") || "/*")) for everything else

The textual path was fragile against IR shapes that don't fit the assumption, formatted JSDoc emitting a Token/Text mix is the most visible case (see #22486).

This PR unifies both paths under a single label: every emitted comment is wrapped in JsLabels::Comment, and classification becomes a pure structural check.

@leaysgur leaysgur requested a review from Dunqing as a code owner May 18, 2026 01:03
@github-actions github-actions Bot added the A-formatter Area - Formatter label May 18, 2026

leaysgur commented May 18, 2026

Copy link
Copy Markdown
Member Author

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@leaysgur leaysgur changed the title refactor(formatter/sort_imports): Wrap every Comments with label refactor(formatter/sort_imports): Wrap every Comment with label May 18, 2026
@codspeed-hq

codspeed-hq Bot commented May 18, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 44 untouched benchmarks
⏩ 7 skipped benchmarks1


Comparing 05-18-refactor_formatter_sort_imports_wrap_every_comments_with_label (eb06c47) with 05-18-fix_formatter_sort_imports_use_label_to_classify_lines (1e587b0)

Open in CodSpeed

Footnotes

  1. 7 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@leaysgur leaysgur added the 0-merge Merge with Graphite Merge Queue label May 18, 2026

leaysgur commented May 18, 2026

Copy link
Copy Markdown
Member Author

Merge activity

@leaysgur

Copy link
Copy Markdown
Member Author

/oxfmt-ecosys

…2514)

Standardize how the `sort_imports` IR transform identifies comments.

Previously it mixed two strategies:

- a label (`JsLabels::AlignableBlockComment`) for multi-line block comments only
- and a textual prefix check (`text.starts_with("//") || "/*")`) for everything else

The textual path was fragile against IR shapes that don't fit the assumption, formatted JSDoc emitting a `Token`/`Text` mix is the most visible case (see #22486).

This PR unifies both paths under a single label: every emitted comment is wrapped in `JsLabels::Comment`, and classification becomes a pure structural check.
@github-actions

github-actions Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

Oxfmt Ecosystem CI

suite oxfmt@latest refs/pull/22514/head branch
eggjs/egg
AmanVarshney01/create-better-t-stack
monkeytypegame/monkeytype
actualbudget/actual
vuejs/pinia
cnpm/cnpmcore
openclaw/openclaw
dyad-sh/dyad
fuma-nama/fumadocs
formatjs/formatjs
fastify/fastify-vite
getsentry/sentry-javascript
lichess-org/lila
tale/headplane
vercel/turborepo
huggingface/huggingface.js
aidenybai/react-grab
vuejs/core
mastodon/mastodon
cloudflare/agents
npmx-dev/npmx.dev
Comfy-Org/ComfyUI_frontend
rolldown/rolldown

@graphite-app graphite-app Bot force-pushed the 05-18-fix_formatter_sort_imports_use_label_to_classify_lines branch from 1e587b0 to 8ee946f Compare May 18, 2026 01:08
@graphite-app graphite-app Bot force-pushed the 05-18-refactor_formatter_sort_imports_wrap_every_comments_with_label branch from eb06c47 to c9f506e Compare May 18, 2026 01:09
Base automatically changed from 05-18-fix_formatter_sort_imports_use_label_to_classify_lines to main May 18, 2026 01:13
@graphite-app graphite-app Bot merged commit c9f506e into main May 18, 2026
30 checks passed
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label May 18, 2026
@graphite-app graphite-app Bot deleted the 05-18-refactor_formatter_sort_imports_wrap_every_comments_with_label branch May 18, 2026 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-formatter Area - Formatter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant