-
Notifications
You must be signed in to change notification settings - Fork 864
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
allow aborting if we have unsupported configurations #5022
Comments
Love this idea, thanks for the suggestion! |
cc @ytmimi in case you'd have any interest working on this since it's something a bit different (no worries if not though!) Main portions in the code to start digging into would be Line 296 in f7c4a44
and Lines 327 to 350 in f7c4a44
Thought some minor tweaks may be needed to track whether the config attempted to use a nightly option outside nightly |
Thanks for thinking of me! Also, I appreciate you pointing out a place to start. I'm eager to take a crack at it, and I'll let you know if I run into any problems or have any questions. |
Good evening!
This is a feature request (AFAIKT there's no configuration option or duplicate issue for this).
In many cases where nightly rustfmt is applied by CI in public repositories, users will often run
cargo fmt
themselves directly or through their editor causing warnings arising from using the stable rustfmt where the nightly is required. E.g.:The problem here is that
cargo fmt
will succeed regardless (and there is no way to avoid this). Succeeding here is strictly worse than not doing anything because it will reformat the entire file / project with the wrong settings (and it's not always clear to the user that this has happened).(This is mostly a problem in projects that do not compile with nightly - and lack an override - but uses nightly for convenience tooling like
rustfmt
).My thought is that there could maybe be a configuration for
abort_on_unrecognised_options
causingrustfmt
to exit 1 where it normally would emit a warning.The text was updated successfully, but these errors were encountered: