rust-lang / rust-lang/rustfmt

Stabilise --emit=checkstyle

Open
#4,614 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-stabilisation-request
Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
2d 13h
Merged PRs (30d)
24

Description

--emit=checkstyle has existed in rustfmt for a number of years. Although there have been some bugs fixed in the past, nothing has been mentioned in the last year or so when it was suggested checkstyle/json were considered stable: https://github.com/rust-lang/rustfmt/issues/3947#issuecomment-561464005 I believe using these features still requires a nightly build of rustfmt: https://github.com/rust-lang/rustfmt/blob/rustfmt-1.4.31/src/bin/main.rs#L496

This feature is useful for integrating rustfmt into existing code lint pipelines which support checkstyle from other languages. It would be helpful to me to have this support in a stable rust release to avoid managing a nightly build for this feature.

I can't see any documentation or issues which describe why some emit options are behind a nightly release, so opening this to make progress or at least document the current state.

Two questions to start with:

  1. Is there a path forward for these features to become available in stable builds of rustfmt & therefore stable builds of rust/cargo/etc?
  2. Would a change to stablise this on a pre-2.0 feature branch be accepted? An untested/draft patch

PS Thank you for the effort put into this project. I can see there's a near constant stream of issues/bug reports here. I'm hoping this doesn't just add to the noise.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with rustfmt-1.4.31/src/bin/main.rs around line 496 and review the linked rustfmt issue discussion about checkstyle/json stability. Compare the referenced draft patch to the current project state. Done means reaching and documenting a clear decision on stable availability, or implementing and validating the accepted stabilization path.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.