code checker: add 'make check_struct_comments'

This utility uses Python's clang module to validate comments intended
to match the struct member names. `cmake_static_check_clang.py` has
been written to support adding other checkers in the future.
This commit is contained in:
Campbell Barton
2023-07-18 14:18:08 +10:00
parent 17563e9a91
commit 2c9aa2c8e5
2 changed files with 552 additions and 0 deletions

View File

@@ -59,6 +59,7 @@ Static Source Code Checking
* check_cppcheck: Run blender source through cppcheck (C & C++).
* check_clang_array: Run blender source through clang array checking script (C & C++).
* check_struct_comments: Check struct member comments are correct (C & C++).
* check_deprecated: Check if there is any deprecated code to remove.
* check_descriptions: Check for duplicate/invalid descriptions.
* check_licenses: Check license headers follow the SPDX license specification,
@@ -468,6 +469,13 @@ check_cppcheck: .FORCE
"$(BLENDER_DIR)/check_cppcheck.txt"
@echo "written: check_cppcheck.txt"
check_struct_comments: .FORCE
@$(CMAKE_CONFIG)
@cd "$(BUILD_DIR)" ; \
$(PYTHON) \
"$(BLENDER_DIR)/build_files/cmake/cmake_static_check_clang.py" \
--checks=struct_comments --match=".*"
check_clang_array: .FORCE
@$(CMAKE_CONFIG)
@cd "$(BUILD_DIR)" ; \