fix: preserve default-config key order in Configuration.dump - #200
Open
Sanjays2402 wants to merge 1 commit into
Open
fix: preserve default-config key order in Configuration.dump#200Sanjays2402 wants to merge 1 commit into
Sanjays2402 wants to merge 1 commit into
Conversation
Configuration.dump documents that key order comes from the default configuration, but it builds its mapping from flatten(), which walks keys() in source-priority order. Any key present only in the defaults was therefore emitted after every key of the higher-priority user source, so a default key such as beets' paths could land inside a later section (reported as appearing under the Plugins header). Reorder the flattened mapping so keys declared by default sources come first, in their declared order, with remaining keys appended. Adds a regression test covering a user source that reorders keys.
|
Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry. |
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.
Closes #195
Configuration.dumpdocuments that key order comes from the default configuration, but it builds its mapping fromflatten(), which walkskeys()in source-priority order. A key present only in the defaults is therefore emitted after every key of the higher-priority user source — so in the reported casepaths(a default key) landed afterpluginsand appeared to be under the Plugins header.The dumped mapping now lists default-source keys first in their declared order, with any remaining keys appended. New
test_dump_follows_default_key_orderfails without the change and passes with it; the rest of the suite is unchanged (294 passed).