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

Function _find_examples

ci/util/smart_selector.py:298–330  ·  view source on GitHub ↗

Find all examples in the examples directory. Args: project_dir: Project root directory Returns: List of TestMatch objects for examples

(project_dir: Path)

Source from the content-addressed store, hash-verified

296
297
298def _find_examples(project_dir: Path) -> list[TestMatch]:
299 """Find all examples in the examples directory.
300
301 Args:
302 project_dir: Project root directory
303
304 Returns:
305 List of TestMatch objects for examples
306 """
307 examples_dir = project_dir / "examples"
308 if not examples_dir.exists():
309 return []
310
311 matches: list[TestMatch] = []
312
313 # Find all .ino files in examples directory
314 for ino_file in examples_dir.rglob("*.ino"):
315 # Example name is the directory name
316 example_name = ino_file.parent.name
317
318 # Get relative path to example directory
319 rel_path = ino_file.parent.relative_to(project_dir)
320
321 matches.append(
322 TestMatch(
323 name=example_name,
324 path=str(rel_path).replace("\\", "/"),
325 type="example",
326 score=0.0, # Will be calculated during matching
327 )
328 )
329
330 return matches
331
332
333def _find_aggregator_matches(

Callers 2

smart_selectFunction · 0.85
discover_all_testsFunction · 0.85

Calls 2

TestMatchClass · 0.85
appendMethod · 0.45

Tested by

no test coverage detected