Only process .h, .hpp, .cpp.hpp files under src/fl/.
(self, file_path: str)
| 93 | self.violations: dict[str, list[tuple[int, str]]] = {} |
| 94 | |
| 95 | def should_process_file(self, file_path: str) -> bool: |
| 96 | """Only process .h, .hpp, .cpp.hpp files under src/fl/.""" |
| 97 | normalized = file_path.replace("\\", "/") |
| 98 | |
| 99 | # Must be under src/fl/ |
| 100 | if "/src/fl/" not in normalized: |
| 101 | return False |
| 102 | |
| 103 | # Skip third_party |
| 104 | if "/third_party/" in normalized: |
| 105 | return False |
| 106 | |
| 107 | # Skip excluded basenames |
| 108 | basename = Path(file_path).name |
| 109 | if basename in _EXCLUDED_BASENAMES: |
| 110 | return False |
| 111 | |
| 112 | # Only header-like files |
| 113 | return normalized.endswith((".h", ".hpp", ".cpp.hpp")) |
| 114 | |
| 115 | def check_file_content(self, file_content: FileContent) -> list[str]: |
| 116 | """Check file for bare using declarations at namespace scope.""" |