Skip to content

✨ feat(mq-formatter): support stdin/stdout mode via -#2082

Merged
harehare merged 2 commits into
mainfrom
fix/mq-fmt-readme-and-stdin-mode
Jul 25, 2026
Merged

✨ feat(mq-formatter): support stdin/stdout mode via -#2082
harehare merged 2 commits into
mainfrom
fix/mq-fmt-readme-and-stdin-mode

Conversation

@harehare

Copy link
Copy Markdown
Owner

Summary

Passing - as the sole file argument reads the query from stdin and
writes the formatted result to stdout instead of requiring a file
path on disk, matching tools like rustfmt's stdin mode. --check -
validates stdin without writing anything. Since mq fmt dispatches
to mq-fmt as an external subcommand with inherited stdio, this also
works transparently via mq fmt -.

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

harehare added 2 commits July 25, 2026 11:05
The install script downloads and installs mq-fmt, but the README
described it as mq-crawl (leftover copy-paste from mq-crawler docs).
Passing `-` as the sole file argument reads the query from stdin and
writes the formatted result to stdout instead of requiring a file
path on disk, matching tools like rustfmt's stdin mode. `--check -`
validates stdin without writing anything. Since `mq fmt` dispatches
to `mq-fmt` as an external subcommand with inherited stdio, this also
works transparently via `mq fmt -`.
@harehare
harehare merged commit 50775d1 into main Jul 25, 2026
10 checks passed
@harehare
harehare deleted the fix/mq-fmt-readme-and-stdin-mode branch July 25, 2026 03:06
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