(tree: Dict, parents: list[str] | None = None)
| 245 | if not d.startswith(".") and d not in ("node_modules", "__pycache__", "venv", ".venv") |
| 246 | ] |
| 247 | for filename in filenames: |
| 248 | filepath = Path(dirpath) / filename |
| 249 | if filepath.suffix.lower() not in source_extensions: |
| 250 | continue |
| 251 | try: |
| 252 | if filepath.stat().st_mtime > prev_time: |
| 253 | rel_path = filepath.relative_to(repo_path).as_posix() |
| 254 | changed.append(rel_path) |
| 255 | except OSError: |
| 256 | continue |
| 257 | |
| 258 | return {"changed_files": changed, "method": "mtime"} |
| 259 | |
| 260 | |
| 261 | def _find_affected_modules( |
| 262 | module_tree: dict[str, Any], |
| 263 | changed_files: list[str], |
| 264 | ) -> tuple[set, set]: |
| 265 | """Map changed files to affected modules using module_tree.json. |
| 266 | |
| 267 | Uses substring matching (same as the CLI ``_invalidate_affected_modules``). |
| 268 | Returns (affected_modules, cascade_parent_modules). |
| 269 | """ |
| 270 | affected: set[str] = set() |
| 271 | cascade: set[str] = set() |
| 272 | |
| 273 | def _walk(tree: dict, parents: list[str] | None = None): |
| 274 | if parents is None: |
no test coverage detected