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)
| 304 | |
| 305 | |
| 306 | def _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 | |
| 324 | def _is_in_platforms_dir(path_obj: Path) -> bool: |
no outgoing calls