-
Notifications
You must be signed in to change notification settings - Fork 1.7k
deny_unknown_fields in the configuration file #2572
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
base: master
Are you sure you want to change the base?
Conversation
To avoid typos and make the config reading stricter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! However, I don't think we can go directly to making this an error. See #1595 for a discussion about how this can be approached and some of the complexities.
src/config.rs
Outdated
#[test] | ||
#[should_panic(expected = "Invalid configuration file")] | ||
fn fail_on_invalid_config_field() { | ||
let src = r#" | ||
[book] | ||
password = Secret | ||
"#; | ||
|
||
Config::from_str(src).unwrap(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this test is actually checking the change in this PR. It seems to be checking that the TOML syntax is invalid.
Oh, right, I am still not used to the requirement of quotes in toml files. I'll now look into #1595 |
To avoid typos and make the config reading stricter.
See #2493