chore(tasks): unify printing differences for mismatch code#18441
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via 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. |
Merging this PR will not alter performance
Comparing Footnotes
|
Merge activity
|
6271dbb to
e1d09db
Compare
9cf4b23 to
d7f6b44
Compare
e1d09db to
0d8bd07
Compare
d7f6b44 to
abf442f
Compare
abf442f to
d12914f
Compare
d12914f to
e4dc98d
Compare
There was a problem hiding this comment.
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) intasks/commonto create and print diffs from two strings. - Update conformance/tests to call the unified diff printer instead of manually constructing
TextDiff. - Remove direct
similardependencies 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.
e4dc98d to
3ea261e
Compare
0f1c3dc to
a6d8a53
Compare
|
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.
a6d8a53 to
4d97ba3
Compare

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