Repository navigation
restore some config tests - #4064
Merged
topecongiro merged 1 commit intoApr 16, 2020
Merged
Conversation
calebcartwright
commented
Feb 26, 2020
| let mut config = Config::default(); | ||
| assert_eq!(config.unstable_features(), false); | ||
| config.set().unstable_features(true); | ||
| assert_eq!(config.unstable_features(), true); |
Member
Author
There was a problem hiding this comment.
I didn't expect this to be the case, but apparently we don't check the stability attribute of config options for set and override_value. That seems to imply that folks can technically already use unstable rustfmt options on stable anyway, though only via command line overrides to rustfmt
Contributor
There was a problem hiding this comment.
Hmm, that's unfortunate. I will reconsider what we should do about unstable features on stable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #2183. I saw these again the other day when I was in the config module and decided to take a closer look at them.
CFG_RELEASE_CHANNELis now checked at compile time, so the original issue with sequencing of tests that were mutating the shared env vars during test exection is no longer relevant.rustfmt/rustfmt-core/rustfmt-config/src/config_type.rs
Lines 338 to 342 in 9124dd8
Instead, I split out the tests for nightly vs. non-nightly with their respective assertions accordingly, and the latter set of tests will run as part of one of the CI jobs (ex: https://travis-ci.com/rust-lang/rustfmt/jobs/291200498).
All that being said.. 😄
@topecongiro in #3387 (comment) you mentioned removing
unstable_featuresaltogether as part of 2.0, so would you rather I go ahead and just remove theunstable_featuresconfig option (and related content like the original commented out tests) altogether?Happy to do so if that's the plan, though based on the thread in #3387 it seems like users would be interested in having the ability to opt-in to being able to use non-stablized rustfmt config options even on stable (not available today). FWIW I can understand that request, and I believe
libtestsupportssomething similar today:
This will fail (
jsonformat is unstable)but this works