Yield tracked-suffix files under each target (recursive for dirs). Skips build / _deps / .git / vendored directories so generated and third-party artifacts aren't touched.
(targets: list[Path])
| 1824 | |
| 1825 | |
| 1826 | def iter_source_files(targets: list[Path]) -> Iterable[Path]: |
| 1827 | """Yield tracked-suffix files under each target (recursive for dirs). |
| 1828 | Skips build / _deps / .git / vendored directories so generated and |
| 1829 | third-party artifacts aren't touched.""" |
| 1830 | for target in targets: |
| 1831 | if target.is_file(): |
| 1832 | if target.suffix in _TRACKED_SUFFIXES: |
| 1833 | yield target |
| 1834 | continue |
| 1835 | for root, dirs, files in os.walk(target): |
| 1836 | dirs[:] = [d for d in dirs if d not in _SKIP_DIRS] |
| 1837 | for name in files: |
| 1838 | if name.endswith(_TRACKED_SUFFIXES): |
| 1839 | yield Path(root) / name |
| 1840 | |
| 1841 | |
| 1842 | # --------------------------------------------------------------------------- |