fix(oxfmt): Make Rust CLI as just formatting CLI#16768
fix(oxfmt): Make Rust CLI as just formatting CLI#16768graphite-app[bot] merged 1 commit intomainfrom
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. |
There was a problem hiding this comment.
Enabling oxfmt default features in tasks/website_formatter is a potentially significant packaging/CI regression (extra deps, slower builds, possible platform constraints) and doesn’t clearly follow from making the Rust CLI formatting-only. Also, relying on cfg_attr(... expect(irrefutable_let_patterns)) in FormatRunner weakens compile-time guarantees; a small cfg-split can encode the invariant more robustly.
Summary of changes
Summary
This PR narrows the pure Rust oxfmt CLI to be a formatting-only entrypoint and gates non-formatting modes behind the napi feature.
Key changes
Mode::{Init,Lsp}are now#[cfg(feature = "napi")]apps/oxfmt/src/cli/command.rswraps the--initand--lspflag parsing incfg(feature = "napi")blocks.- When
napiis not enabled, only the formatting output mode parser is exposed with aMode::Cli(OutputMode::Write)fallback.
FormatRunnerassumesMode::Cliapps/oxfmt/src/cli/format.rskeeps theMode::Clidestructure, adding acfg_attrto silence the irrefutable pattern lint whennapiis disabled.
main.rsbecomes formatting-only- Removes the
matchoverModeand always initializes tracing/miette/rayon then runsFormatRunner.
- Removes the
- Website formatter now uses
oxfmtdefault featurestasks/website_formatter/Cargo.tomlswitches fromdefault-features = falseto default features enabled.
Merge activity
|
1323c0e to
2577814
Compare
When adding new features primarily using JS via napi, to reduce future maintenance burdens such as missed implementations.
ca7f3b3 to
b6f4a3e
Compare
When adding new features primarily using JS via napi, to reduce future maintenance burdens such as missed implementations.
b6f4a3e to
d719988
Compare

When adding new features primarily using JS via napi, to reduce future maintenance burdens such as missed implementations.