feat: replace rglob with os.walk and per-language directory pruning#1539
feat: replace rglob with os.walk and per-language directory pruning#1539
Conversation
File discovery used Path.rglob per extension, traversing excluded dirs (e.g. .venv, node_modules) before filtering. Switch to a single os.walk pass with in-place dirs[:] pruning. Each language now declares its own dir_excludes patterns (exact, prefix*, *suffix) on the LanguageSupport protocol, parsed by parse_dir_excludes() at walk time.
|
codeflash should optimize this |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
PR Review SummaryPrek Checks✅ All checks pass ( Mypy53 errors found in the 4 changed files, but all are pre-existing — none are introduced by this PR. The new code ( Code ReviewThe refactoring from
Since Test Coverage
✅ No coverage regression. Slight improvement in Note: 8 pre-existing test failures in Last updated: 2026-02-19 |
Remove codeflash-specific tessl tiles, add new pypi tiles from pyproject.toml, and run uv sync --upgrade to bump dependencies.
Replace skills gitignores with MCP server config for codex and gemini.
feat: replace rglob with os.walk and per-language directory pruning
Summary
Path.rglobinget_files_for_language()with a singleos.walkpass that prunes excluded directories in-place, avoiding traversal of.venv,node_modules,.git, etc.dir_excludesproperty toLanguageSupportprotocol so each language declares its own exclusion patterns (exact names,prefix*,*suffix)Test plan
pytest tests/test_function_discovery.py— 14 passedpytest tests/test_languages/test_function_discovery_integration.py— 14 passedruff checkclean on all changed files