fix: fields missing from config.toml parsing logic#1843
Merged
mre merged 3 commits intolycheeverse:masterfrom Sep 9, 2025
Merged
fix: fields missing from config.toml parsing logic#1843mre merged 3 commits intolycheeverse:masterfrom
mre merged 3 commits intolycheeverse:masterfrom
Conversation
the `fold_in!` macro relies on the listed fields in order to know which
fields to merge from the toml file.
if fields were missing from this list, as they were previously, then
the toml file values for those fields would be silently ignored.
this also sorts the field list alphabetically.
it would be nice if there was a "kitchen sink" toml file which had every
option set. maybe this could be auto-generated.
command to list all config fields:
```
grep --after-context=10000 'pub(crate) struct Config' \
lychee-bin/src/options.rs | grep ' pub(crate) ' \
| cut -d' ' -f6 | grep : | sort
```
getting all fields within `fold_in!` was done by vim `ya{`
fold_in macro
Member
|
Nice. Yeah, that sort of problem keeps resurfacing. Would be nice to get a compile-time error if we forgot to fold a field. Or maybe we can look into alternatives like https://github.com/gibfahn/clap_config or similar, but that would be a bigger change. It might not be so easy because we also want to skip a few fields as you mentioned.
The closest thing to that is https://github.com/lycheeverse/lychee/blob/master/fixtures/configs/smoketest.toml but I'm sure there are missing options by now. Might be worth investigating. Either way, thanks for fixing. |
Closed
This was referenced Oct 21, 2025
Closed
Merged
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.
the
fold_in!macro relies on the listed fields in order to know which fields to merge from the toml file. if fields were missing from this list, as they were previously, then the toml file values for those fields would be silently ignored.this pr adds those missing fields, except for header and github_token which are handled separately. this also sorts the field list alphabetically.
it would be nice if there was a "kitchen sink" toml file which had every option set. maybe this could be auto-generated (related to #1768).
command to list all config fields:
getting all fields within
fold_in!was done by vimya{