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

[unstable option] normalize_comments #3350

Open
Tracked by #83
scampi opened this issue Feb 13, 2019 · 3 comments
Open
Tracked by #83

[unstable option] normalize_comments #3350

scampi opened this issue Feb 13, 2019 · 3 comments
Labels
unstable option tracking issue of an unstable option

Comments

@scampi
Copy link
Contributor

scampi commented Feb 13, 2019

Tracking issue for unstable option: normalize_comments

@scampi scampi added the unstable option tracking issue of an unstable option label Feb 13, 2019
@scampi scampi changed the title [unstable option] unstable option: normalize_comments [unstable option] normalize_comments Feb 18, 2019
@Veetaha
Copy link

Veetaha commented May 2, 2020

@scampi is there any plan to stabilize this option? At least ensuring single whitespace after // would be very useful for my use-case...

@ia0
Copy link

ia0 commented Oct 10, 2020

With rustfmt 1.4.22-nightly (97d0301 2020-10-04) it looks like enabling this option does the opposite of what the documentation says.

enum Foo {
    X1,
    // X2,
    // X3,
}

gives

enum Foo {
    X1,
    /* X2,
     * X3, */
}

instead of doing nothing.

Is that expected?

mnmaita added a commit to mnmaita/bevy that referenced this issue Mar 9, 2021
Check rust-lang/rustfmt#3350 to track
stabilization of this option.
bors bot pushed a commit to bevyengine/bevy that referenced this issue Mar 10, 2021
Aims to close #1594.

These options are unstable and depend on the following PR's:

[wrap_comments](https://rust-lang.github.io/rustfmt/?version=v1.4.36&search=#wrap_comments): rust-lang/rustfmt#3347

[comment_width](https://rust-lang.github.io/rustfmt/?version=v1.4.36&search=#comment_width): rust-lang/rustfmt#3349

[normalize_comments](https://rust-lang.github.io/rustfmt/?version=v1.4.36&search=#normalize_comments): rust-lang/rustfmt#3350

@alice-i-cecile do you think this will solve the issue? When enabled, running the formatter locally should take the configurations into account to format comments. `--check` runs should also be considering them. This should be testable on the `nightly` toolchain.

~I didn't delve into normalizing `//` vs `/* */` though, should I take a look into that too? [normalize_comments](https://rust-lang.github.io/rustfmt/?version=v1.4.36&search=#normalize_comments) seems to be the solution for that but it's also unstable (tracking issue: rust-lang/rustfmt#3350). I can also add this configuration (commented out, of course) if it's desirable.~ Added `normalize_comments` option.
@tgross35
Copy link
Contributor

I think @ia0's issue was resolved by #4909

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unstable option tracking issue of an unstable option
Projects
None yet
Development

No branches or pull requests

4 participants