fix(inbox): case-fold configured extensions to match scan() - #733
Open
Yurii214 wants to merge 1 commit into
Open
fix(inbox): case-fold configured extensions to match scan()#733Yurii214 wants to merge 1 commit into
Yurii214 wants to merge 1 commit into
Conversation
scan() compares `path.suffix.lower()` against cfg.extensions, but load_config stored the configured list verbatim. a config like `inbox.extensions: [".MD"]` therefore matched no file at all and silently skipped the whole inbox, since the compared side is always lowercased. case-fold configured extensions in load_config so the config side matches the file side — the same defensive coercion the `enabled: "false"` handling already applies.
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.
what
vouch inbox <dir>silently skips every file wheninbox.extensionsis configured with any uppercase or mixed-case value.why
scan()matches files withpath.suffix.lower() not in cfg.extensions(src/vouch/inbox.py:106) — the file side is always case-folded. butload_configstored the configured list verbatim (tuple(str(e) for e in extensions)), so a reasonable config like:can never match anything —
".md"is compared against".MD"— and the whole inbox is skipped with no error.fix
case-fold configured extensions in
load_configso the config side matches the file side. this mirrors the defensive coercion already applied toenabled(theenabled: "false"regression).test
test_load_config_lowercases_configured_extensionsconfigures[".MD", ".TXT"], asserts the parsed config is(".md", ".txt"), and that a droppednotes.mdis proposed rather than skipped. fails on the old verbatim behaviour (('.MD', '.TXT') != ('.md', '.txt')), passes with the fix.gate:
ruff check src tests,mypy src, and the fullpytest tests/ --ignore=tests/embeddingssuite all green.