Skip to content

✨ feat(mq-run): add --diff to -U for safe change preview - #2164

Merged
harehare merged 1 commit into
mainfrom
feat/update-diff-flag
Aug 8, 2026
Merged

✨ feat(mq-run): add --diff to -U for safe change preview#2164
harehare merged 1 commit into
mainfrom
feat/update-diff-flag

Conversation

@harehare

@harehare harehare commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary

Preview what -U would change without writing anything: prints a unified diff of the original input against the transformed output instead of the full content. Multiple files are diffed one at a time with their path in the headers; stdin is labeled <stdin>. Exits 1 if anything would change, 0 otherwise, so it can gate CI/scripts.

Requires --update via clap's requires, and is rejected with -F grep. Diffing always compares against plain (uncolored) text even with -C, to avoid ANSI codes baking into the rendered content and making every line look changed; the diff output colors its own +/-/@@ lines.

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • ♻️ Refactor
  • 📝 Documentation
  • ⚡ Performance
  • ✅ Test
  • 📦 Build / dependencies
  • 👷 CI

Checklist

  • I ran cargo fmt and cargo clippy and addressed any warnings
  • I ran just test-all and all tests pass
  • I added or updated tests covering this change
  • I updated relevant documentation (/docs, crate README.md) if needed
  • I added a changelog entry if this is a user-facing change

Additional Context

Preview what `-U` would change without writing anything: prints a
unified diff of the original input against the transformed output
instead of the full content. Multiple files are diffed one at a time
with their path in the headers; stdin is labeled `<stdin>`. Exits 1
if anything would change, 0 otherwise, so it can gate CI/scripts.

Requires --update via clap's `requires`, and is rejected with -F grep.
Diffing always compares against plain (uncolored) text even with -C,
to avoid ANSI codes baking into the rendered content and making every
line look changed; the diff output colors its own +/-/@@ lines.
@codspeed-hq

codspeed-hq Bot commented Aug 8, 2026

Copy link
Copy Markdown

Hooray! CodSpeed harness just leveled up!

The base and head of this comparison were measured with different runner settings, so their benchmark values are not directly comparable.

What changed between base and head:

Re-run the base with the same settings to get a valid performance comparison.


Comparing feat/update-diff-flag (7cf0ad1) with main (05ed932)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (1c26804) during the generation of this report, so 05ed932 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@harehare
harehare merged commit 20316c1 into main Aug 8, 2026
13 checks passed
@harehare
harehare deleted the feat/update-diff-flag branch August 8, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant