-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Warn on unknown configuration settings #1595
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
Comments
I'm looking into this a bit.
Here are some options:
This makes me think the last option (also the easiest) makes sense since we have to have a I'm happy to code up any (or all, for comparison) of the above scenarios if that would help. |
I think removing the legacy support would be fine, though that would need to be deferred to 0.5. I don't think we can change them to hard errors as that would be a breaking change, so I think that would need to be deferred to 0.5, too. I'm not sure if it makes sense to keep them as warnings or not long term, though. I haven't looked closely, so I'm not sure which would be the best approach. One option is in |
Ok, spent more time with this and I'm pretty sure my 1. and 2. options are invalid because I wasn't accounting for how we do I think my 3. and your first suggestion are more on the right track, but I'm still trying to work out the best way to do it. We could:
I think this works. It should handle the legacy format the same way, only report unknown fields for the three built in sections, and still tack on the |
Any updates on this? I've stumbled upon the code for config file and it's... A bit hard to modify. Would definitely appreciate removal of manual derive implementation, and including some more well-known config blocks into the top-level Config struct would definitely help as well. |
As far as I understand the |
After analyzing 133 public mdbooks I found 21 issues. (listed on the
|
A step for rust-lang#1595. We might need to revise this if de decide to remove the `multilingual` field as described in rust-lang#2636
A step for rust-lang#1595. We might need to revise this if de decide to remove the `multilingual` field as described in rust-lang#2636
When there are unknown settings in
book.toml
, mdbook just ignores them:This has occasionally caused problems and confusion for people when they make typos or mistakes. I think it would be good for unknown options to issue a warning.
serde_ignored
provides a facility for catching these unknown fields.Some care will need to be taken to consider things like plugins which can add their own sections to the config.
The text was updated successfully, but these errors were encountered: