Skip to content

Fix case-sensitive file suffix filtering silently skipping capitalized/mixed-case extensions (#1671)#1674

Open
raman118 wants to merge 1 commit into
Graphify-Labs:v8from
raman118:fix/1671-case-insensitive-extensions
Open

Fix case-sensitive file suffix filtering silently skipping capitalized/mixed-case extensions (#1671)#1674
raman118 wants to merge 1 commit into
Graphify-Labs:v8from
raman118:fix/1671-case-insensitive-extensions

Conversation

@raman118

@raman118 raman118 commented Jul 4, 2026

Copy link
Copy Markdown

This pull request fixes an issue where files with capitalized or mixed-case extensions (such as .PY, .JS, or .TS) were silently skipped during file discovery.

Problem

In extract.py, the collect_files function checks file suffixes against _EXTENSIONS (derived from the keys of the _DISPATCH mapping). Because _DISPATCH only maps lowercase extensions for most languages, files with uppercase or mixed-case extensions were excluded from discovery. Additionally, _get_extractor would fail to resolve an extractor function for such files even if they were manually passed to it.

Solution

  • Modified collect_files to match files if their exact suffix or their lowercase suffix is in _EXTENSIONS.
  • Modified _get_extractor to check _DISPATCH using a lowercase fallback if the exact suffix casing is not registered. This ensures that language-specific case distinctions (such as Fortran .f vs .F) are still respected, while typical languages (like Python, JavaScript, and TypeScript) support uppercase extensions. Also updated the .blade.php check to be case-insensitive.
  • Modified _legacy_collect_files in test_extract.py to enforce case-sensitivity on p.suffix == ext to prevent duplicate matching on Windows.
  • Added a new regression test test_case_insensitive_suffix_filtering to verify that uppercase extensions (.PY, .JS, .Ts) are discovered, mapped to their correct extractors, and successfully parsed.

Fixes #1671

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Case-sensitive file suffix filtering in collect_files() silently skips capitalized/mixed-case extensions

1 participant