MCPcopy Create free account
hub / github.com/FastLED/FastLED / collect_python_files

Function collect_python_files

ci/lint_python/subprocess_capture_checker.py:111–128  ·  view source on GitHub ↗

Walk paths and return all .py files, filtering out excludes.

(
    paths: list[str],
    excludes: list[str],
)

Source from the content-addressed store, hash-verified

109
110
111def collect_python_files(
112 paths: list[str],
113 excludes: list[str],
114) -> list[Path]:
115 """Walk paths and return all .py files, filtering out excludes."""
116 result: list[Path] = []
117 exclude_parts = [e.replace("\\", "/").strip("/") for e in excludes]
118
119 for p_str in paths:
120 p = Path(p_str)
121 if p.is_file() and p.suffix == ".py":
122 if not _is_excluded(p, exclude_parts):
123 result.append(p)
124 elif p.is_dir():
125 for py_file in p.rglob("*.py"):
126 if not _is_excluded(py_file, exclude_parts):
127 result.append(py_file)
128 return result
129
130
131def _is_excluded(path: Path, exclude_parts: list[str]) -> bool:

Callers 1

mainFunction · 0.70

Calls 2

_is_excludedFunction · 0.70
appendMethod · 0.45

Tested by

no test coverage detected