foundry icon indicating copy to clipboard operation
foundry copied to clipboard

feat(config): warn on unknown config keys in foundry.toml

Open zarkk01 opened this issue 6 months ago • 2 comments

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 avatar May 24 '25 21:05 zarkk01

@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!

grandizzy avatar Jun 05 '25 10:06 grandizzy

@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! :)

zarkk01 avatar Jun 05 '25 10:06 zarkk01

hey @zarkk01, do you intend to continue this work? else I could wrap it up and co-author you

zugdev avatar Aug 17 '25 07:08 zugdev

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 :)

zarkk01 avatar Aug 17 '25 22:08 zarkk01

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!

onbjerg avatar Sep 18 '25 14:09 onbjerg