foundry
foundry copied to clipboard
feat(config): warn on unknown config keys in foundry.toml
Motivation
Right now, if a user makes a typo or adds a deprecated field in their local foundry.toml, Figment/Serde simply ignores it and the user never knows something went unused. That can lead to confusion or misconfiguration.
Solution
Before Figment does .extract() into the Config struct, we read foundry.toml as raw TOML, run it through [serde_ignored] to collect any unused/unknown keys, and if any are found we log a warn! listing them. This is non-breaking (we still load all the valid settings) and only affects root keys for now.
About #10550 . For now, could I have some feedback on the implementation?
PR Checklist
- [x] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
@zarkk01 this would be really good to have, wonder if you have time time to wrap up the work (accommodate comments and test to check warnings are emitted). thank you!
@zarkk01 this would be really good to have, wonder if you have time time to wrap up the work (accommodate comments and test to check warnings are emitted). thank you!
Yes, I will wrap it up until the end of the week! :)
hey @zarkk01, do you intend to continue this work? else I could wrap it up and co-author you
hey @zarkk01, do you intend to continue this work? else I could wrap it up and co-author you
Hey, you can of course do. I would really appreciate it, since unfortunately lot of work occured for me lately. Thanks :)
Hi @zugdev @zarkk01, I'm closing this PR as there has been no activity for a while. Please feel free to open up the PR again against master if any of you find the bandwidth. Thanks for the time invested in this, we appreciate it!