Skip to content

fix(inbox): case-fold configured extensions to match scan() - #733

Open
Yurii214 wants to merge 1 commit into
vouchdev:testfrom
Yurii214:fix/inbox-extensions-case-insensitive
Open

fix(inbox): case-fold configured extensions to match scan()#733
Yurii214 wants to merge 1 commit into
vouchdev:testfrom
Yurii214:fix/inbox-extensions-case-insensitive

Conversation

@Yurii214

Copy link
Copy Markdown
Contributor

what

vouch inbox <dir> silently skips every file when inbox.extensions is configured with any uppercase or mixed-case value.

why

scan() matches files with path.suffix.lower() not in cfg.extensions (src/vouch/inbox.py:106) — the file side is always case-folded. but load_config stored the configured list verbatim (tuple(str(e) for e in extensions)), so a reasonable config like:

inbox:
  extensions: [".MD", ".TXT"]

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_config so the config side matches the file side. this mirrors the defensive coercion already applied to enabled (the enabled: "false" regression).

test

test_load_config_lowercases_configured_extensions configures [".MD", ".TXT"], asserts the parsed config is (".md", ".txt"), and that a dropped notes.md is 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 full pytest tests/ --ignore=tests/embeddings suite all green.

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.
@github-actions github-actions Bot added tests tests and fixtures size: XS less than 50 changed non-doc lines labels Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: XS less than 50 changed non-doc lines tests tests and fixtures

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant