You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Documentation-coverage scan doesn't prune os.walk, walks every file in node_modules/.git/etc. anyway #256
File: guidestar_lens.py
Labels: bug, performance, priority:medium
pythonfor root_dir, dirs, files in os.walk(self.root):
dir_path = Path(root_dir)
if any(part in self._gs_config.get("IGNORED_DIRECTORIES", set()) for part in dir_path.parts):
continue
...
continue only skips processing files for the current directory — it never mutates dirs in place (dirs[:] = [...]), which is the only way to stop os.walk from recursing into a subdirectory. So os.walk still descends into and enumerates every single file inside node_modules, .git, vendor, build, etc. before this check discards the result. On any JS/Node repo with a large node_modules, this is a full, pointless filesystem traversal running before the "real" aperture-filtered scan even begins — directly undercutting the project's own "100,000+ LOC/s" performance claims. (This check also compares dir_path.parts against IGNORED_DIRECTORIES without lowercasing, so it inherits the same case-mismatch as Issue #11 independently.)
Fix: prune in place: dirs[:] = [d for d in dirs if d.lower() not in ignored_lower] before the file loop.
Activity
Prune ignored directories in place during documentation-coverage scan (…