Check if the include path is from an external SDK. External SDK headers (like ESP-IDF, Pico SDK, FreeRTOS, Arduino) are allowed to be included with their original paths.
(include_path: str)
| 199 | |
| 200 | |
| 201 | def is_external_sdk_header(include_path: str) -> bool: |
| 202 | """Check if the include path is from an external SDK. |
| 203 | |
| 204 | External SDK headers (like ESP-IDF, Pico SDK, FreeRTOS, Arduino) |
| 205 | are allowed to be included with their original paths. |
| 206 | """ |
| 207 | # First check if it's definitely an SDK header |
| 208 | for prefix in EXTERNAL_SDK_PREFIXES: |
| 209 | if include_path.startswith(prefix): |
| 210 | return True |
| 211 | |
| 212 | # For ambiguous prefixes (avr/, arm/), check if it looks like FastLED code |
| 213 | for prefix in AMBIGUOUS_PREFIXES: |
| 214 | if include_path.startswith(prefix): |
| 215 | # If it looks like FastLED code, it's NOT an SDK header |
| 216 | if looks_like_fastled_code(include_path): |
| 217 | return False |
| 218 | # Otherwise, assume it's an SDK header (e.g., <avr/io.h>) |
| 219 | return True |
| 220 | |
| 221 | return False |
| 222 | |
| 223 | |
| 224 | def is_fastled_platform_relative(include_path: str) -> bool: |
no test coverage detected