Skip to content

chore(tasks): unify printing differences for mismatch code#18441

Merged
graphite-app[bot] merged 1 commit intomainfrom
01-23-chore_tasks_unify_printing_differences_for_mismatch_code
Jan 26, 2026
Merged

chore(tasks): unify printing differences for mismatch code#18441
graphite-app[bot] merged 1 commit intomainfrom
01-23-chore_tasks_unify_printing_differences_for_mismatch_code

Conversation

@Dunqing
Copy link
Member

@Dunqing Dunqing commented Jan 23, 2026

Instead of implementing printing diffs everywhere, use a unified method to make the code cleaner and maintain consistency.

@github-actions github-actions bot added A-transformer Area - Transformer / Transpiler A-formatter Area - Formatter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Jan 23, 2026
Copy link
Member Author

Dunqing commented Jan 23, 2026


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 hot fixes, skip the queue and merge this PR next

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.

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 23, 2026

Merging this PR will not alter performance

✅ 42 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing 01-23-chore_tasks_unify_printing_differences_for_mismatch_code (9cf4b23) with 01-23-chore_prettier_conformance_improve_the_information_that_is_shown_in_filter (6271dbb)

Open in CodSpeed

Footnotes

  1. 3 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.

@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Jan 23, 2026
@graphite-app graphite-app bot changed the base branch from 01-23-chore_prettier_conformance_improve_the_information_that_is_shown_in_filter to graphite-base/18441 January 23, 2026 11:54
@Boshen Boshen added 0-merge Merge with Graphite Merge Queue and removed 0-merge Merge with Graphite Merge Queue labels Jan 25, 2026
Copy link
Member

Boshen commented Jan 25, 2026

Merge activity

@Dunqing Dunqing force-pushed the graphite-base/18441 branch from 6271dbb to e1d09db Compare January 26, 2026 01:35
@Dunqing Dunqing force-pushed the 01-23-chore_tasks_unify_printing_differences_for_mismatch_code branch from 9cf4b23 to d7f6b44 Compare January 26, 2026 01:35
@Dunqing Dunqing changed the base branch from graphite-base/18441 to 01-23-chore_prettier_conformance_improve_the_information_that_is_shown_in_filter January 26, 2026 01:36
@graphite-app graphite-app bot changed the base branch from 01-23-chore_prettier_conformance_improve_the_information_that_is_shown_in_filter to graphite-base/18441 January 26, 2026 01:42
@graphite-app graphite-app bot force-pushed the graphite-base/18441 branch from e1d09db to 0d8bd07 Compare January 26, 2026 01:48
@graphite-app graphite-app bot force-pushed the 01-23-chore_tasks_unify_printing_differences_for_mismatch_code branch from d7f6b44 to abf442f Compare January 26, 2026 01:49
@graphite-app graphite-app bot changed the base branch from graphite-base/18441 to main January 26, 2026 01:49
@graphite-app graphite-app bot force-pushed the 01-23-chore_tasks_unify_printing_differences_for_mismatch_code branch from abf442f to d12914f Compare January 26, 2026 01:49
Copilot AI review requested due to automatic review settings January 26, 2026 02:09
@Dunqing Dunqing force-pushed the 01-23-chore_tasks_unify_printing_differences_for_mismatch_code branch from d12914f to e4dc98d Compare January 26, 2026 02:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR centralizes “expected vs actual” diff printing into a single helper (print_diff_in_terminal) and replaces ad-hoc similar::TextDiff usage at call sites.

Changes:

  • Add a simple wrapper API (print_diff_in_terminal) in tasks/common to create and print diffs from two strings.
  • Update conformance/tests to call the unified diff printer instead of manually constructing TextDiff.
  • Remove direct similar dependencies where they’re no longer needed.

Reviewed changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tasks/transform_conformance/src/test_case.rs Switches mismatch diff printing to print_diff_in_terminal.
tasks/transform_conformance/Cargo.toml Drops direct similar dependency after refactor.
tasks/coverage/Cargo.toml Adds constcat/cow-utils dependencies (currently appears unrelated to diff refactor).
tasks/common/src/diff.rs Introduces print_diff_in_terminal wrapper over TextDiff + print_text_diff.
crates/oxc_transformer_plugins/src/module_runner_transform.rs Updates tests to use print_diff_in_terminal for mismatch output.
crates/oxc_transformer_plugins/Cargo.toml Removes similar dev-dependency (no longer directly used).
crates/oxc_formatter/Cargo.toml Removes oxc_tasks_common dev-dependency (but example still uses it).
Cargo.lock Updates lockfile to reflect dependency changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@leaysgur leaysgur force-pushed the 01-23-chore_tasks_unify_printing_differences_for_mismatch_code branch from e4dc98d to 3ea261e Compare January 26, 2026 05:08
@leaysgur leaysgur force-pushed the 01-23-chore_tasks_unify_printing_differences_for_mismatch_code branch 2 times, most recently from 0f1c3dc to a6d8a53 Compare January 26, 2026 05:10
@leaysgur
Copy link
Member

leaysgur commented Jan 26, 2026

Addressed Copilot review, both seemed valid, we missed updating usage.

I hope it will be merged after CI by Graphite...!

Instead of implementing printing diffs everywhere, use a unified method to make the code cleaner and maintain consistency.
@graphite-app graphite-app bot force-pushed the 01-23-chore_tasks_unify_printing_differences_for_mismatch_code branch from a6d8a53 to 4d97ba3 Compare January 26, 2026 05:16
@graphite-app graphite-app bot merged commit 4d97ba3 into main Jan 26, 2026
22 checks passed
@graphite-app graphite-app bot deleted the 01-23-chore_tasks_unify_printing_differences_for_mismatch_code branch January 26, 2026 05:23
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-formatter Area - Formatter A-transformer Area - Transformer / Transpiler C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants