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

Function _fast_scan_dominated

ci/lint_cpp/native_platform_defines_checker.py:306–321  ·  view source on GitHub ↗

Return True if the file *might* contain a flaggable violation. This is the fast path. It may return True for files that ultimately have zero violations (false positive), but it must never return False for a file that has real violations (no false negatives). The check is: file cont

(content: str)

Source from the content-addressed store, hash-verified

304
305
306def _fast_scan_dominated(content: str) -> bool:
307 """Return True if the file *might* contain a flaggable violation.
308
309 This is the fast path. It may return True for files that ultimately have
310 zero violations (false positive), but it must never return False for a
311 file that has real violations (no false negatives).
312
313 The check is: file contains at least one preprocessor conditional AND
314 at least one of the native defines we care about.
315 """
316 if not _FAST_HAS_CONDITIONAL_RE.search(content):
317 return False
318 for native_define in NATIVE_TO_MODERN_DEFINES:
319 if native_define in content:
320 return True
321 return False
322
323
324def _is_in_platforms_dir(path_obj: Path) -> bool:

Calls

no outgoing calls