Check for legacy _build.hpp files (all should now be _build.cpp.hpp). Returns: list of violation strings
(src_dir: Path)
| 242 | |
| 243 | |
| 244 | def _check_build_hpp_naming(src_dir: Path) -> list[str]: |
| 245 | """ |
| 246 | Check for legacy _build.hpp files (all should now be _build.cpp.hpp). |
| 247 | |
| 248 | Returns: |
| 249 | list of violation strings |
| 250 | """ |
| 251 | violations: list[str] = [] |
| 252 | |
| 253 | # Check for any legacy _build.hpp files |
| 254 | for build_hpp in src_dir.rglob("_build.hpp"): |
| 255 | content = build_hpp.read_text(encoding="utf-8") |
| 256 | |
| 257 | # If it includes .cpp.hpp files, it should be renamed |
| 258 | if CPP_HPP_INCLUDE_PATTERN.search(content): |
| 259 | rel_file = build_hpp.relative_to(PROJECT_ROOT) |
| 260 | expected_name = build_hpp.parent / BUILD_CPP_HPP |
| 261 | rel_expected = expected_name.relative_to(PROJECT_ROOT) |
| 262 | violations.append( |
| 263 | f"{rel_file.as_posix()}: Legacy _build.hpp file includes .cpp.hpp files. " |
| 264 | f"Should be renamed to '{rel_expected.as_posix()}' to follow implementation file convention." |
| 265 | ) |
| 266 | |
| 267 | return violations |
| 268 | |
| 269 | |
| 270 | def check_hierarchy(src_dir: Path) -> list[str]: |
no test coverage detected