Check if a header is a known external SDK header that should use angle brackets.
(header_name: str)
| 462 | |
| 463 | |
| 464 | def is_known_sdk_header(header_name: str) -> bool: |
| 465 | """Check if a header is a known external SDK header that should use angle brackets.""" |
| 466 | from pathlib import Path |
| 467 | |
| 468 | # Windows SDK headers |
| 469 | windows_headers = { |
| 470 | "errhandlingapi.h", |
| 471 | "minwindef.h", |
| 472 | "winbase.h", |
| 473 | "processthreadsapi.h", |
| 474 | } |
| 475 | # ESP8266 SDK headers |
| 476 | esp8266_headers = {"esp8266_peri.h", "osapi.h", "user_interface.h"} |
| 477 | # External libraries |
| 478 | external_libs = {"NeoPixelBus.h"} |
| 479 | |
| 480 | basename = Path(header_name).name |
| 481 | return basename in (windows_headers | esp8266_headers | external_libs) |
| 482 | |
| 483 | |
| 484 | def apply_fixes(violations_dict: dict, file_contents: dict) -> tuple[int, int]: |