MCPcopy Create free account
hub / github.com/FastLED/FastLED / _check_build_hpp_naming

Function _check_build_hpp_naming

ci/lint_cpp/test_unity_build.py:244–267  ·  view source on GitHub ↗

Check for legacy _build.hpp files (all should now be _build.cpp.hpp). Returns: list of violation strings

(src_dir: Path)

Source from the content-addressed store, hash-verified

242
243
244def _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
270def check_hierarchy(src_dir: Path) -> list[str]:

Callers 1

check_scanned_dataFunction · 0.85

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected