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

Remove nightly-only options in rustfmt config #1303

Merged
merged 1 commit into from
Apr 26, 2023
Merged

Conversation

romac
Copy link
Member

@romac romac commented Apr 26, 2023

These options cannot be used on stable Rust, which we use for developing the library and on CI for checking the formatting. As such they should be removed from the .rustfmt.toml config, as they can otherwise be picked up by some IDEs which will automatically use the nightly rustfmt to honor the unstable options.

@romac romac requested a review from mzabaluev April 26, 2023 09:17
@codecov-commenter
Copy link

Codecov Report

Merging #1303 (6b2bf4f) into main (9f0ee2b) will not change coverage.
The diff coverage is n/a.

❗ Current head 6b2bf4f differs from pull request most recent head 6718edc. Consider uploading reports for the commit 6718edc to get more accurate results

@@          Coverage Diff          @@
##            main   #1303   +/-   ##
=====================================
  Coverage   64.2%   64.2%           
=====================================
  Files        271     271           
  Lines      24472   24472           
=====================================
  Hits       15732   15732           
  Misses      8740    8740           

see 4 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@thanethomson thanethomson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any idea when these formatting options will make their way into stable? This file's been configured like this for ages now, and these formatting conventions have served us pretty well.

But I'm also all for not depending on nightly 🙂

@romac
Copy link
Member Author

romac commented Apr 26, 2023

We're actually formatting and checking the code with the stable toolchain so those had no effect up to now afaict. At least it on my machine, running cargo fmt or formatting with rust-analyzer on stable does not pick them up.

I only noticed this because my new Neovim distrib (AstroNvim) seems to use nightly rustfmt by default, hence this PR to ensure it does not reformat all the code I touch using the unstable settings.

@romac
Copy link
Member Author

romac commented Apr 26, 2023

No idea as to when these options will become stable but I wouldn't hold my breath given that they've unstable for years now.

@romac romac merged commit e298247 into main Apr 26, 2023
@romac romac deleted the romac/rustfmt-nightly branch April 26, 2023 11:38
@romac romac mentioned this pull request May 2, 2023
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.

3 participants