Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use --message-format=json #3947

Closed
JP-Ellis opened this issue Nov 28, 2019 · 2 comments
Closed

Unable to use --message-format=json #3947

JP-Ellis opened this issue Nov 28, 2019 · 2 comments

Comments

@JP-Ellis
Copy link

I recently found the undocumented --message-format option from #3752; however, trying to use it results in the following error message:

$ cargo fmt --message-format=json
Invalid value for `--emit` - using an unstable value without `--unstable-features`

so as the error message suggests, I tried enabling unstable features, but this can only be done on the nightly branch.

Is there a tracking issue or eta as to when this will land in the stable channel?

@calebcartwright
Copy link
Member

the undocumented --message-format option

The CLI help text for cargo fmt includes info on the various flags/options it accepts, including --message-format. AFAIK the cargo fmt specific flags/opts are not explicitly documented anywhere else. However, if they are but are missing --message-format then that should be remedied.

Is there a tracking issue or eta as to when this will land in the stable channel?

Good question. The --message-format option to cargo fmt is translated into the corresponding --emit mode for rustfmt, so the underlying driver of the nightly requirement for --message-format json is that the json emitter is still technically nightly-only: https://github.com/rust-lang/rustfmt#tips (scroll down to the emit mode table).

I'm not aware of any tracking issue for the stabilization of the json emit mode, but IMO both the json and checkstyle emitters are ready for stabilization.

@calebcartwright
Copy link
Member

Oops, sorry I'm wrong about the stabilization readiness. I forgot about an issue that can occur with the json emitter (as well as the checkstyle emitter) that should be resolved first, now detailed in #3952

I'll open a PR with a fix for #3952 within the next day or so, after which I believe the json emitter (and thus cargo fmt's --message-format json option) will be ready for stabilization.

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

No branches or pull requests

3 participants