mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2026-11-25 21:21:37 +00:00
feat(tidy): build the checks as a clang-tidy plugin
- Add the MODULE library fairmq-tidy-plugin, installed as libfairmq-tidy-checks.so. It adds the fairmq-* checks to a stock clang-tidy of the same LLVM release via --load. - Do not link the LLVM libraries into the plugin: the loading clang-tidy has them. - Run every check test also through the plugin, if a clang-tidy of the found LLVM installation exists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,7 +16,8 @@
|
||||
# Any warning or error without a CHECK-MESSAGES line fails the test.
|
||||
#
|
||||
# Usage: cmake -DTIDY=<exe> -DFILECHECK=<exe> -DCHECK=<name> -DINPUT=<file>
|
||||
# -DFLAGS=<file with one compiler flag per line> -DWORKDIR=<dir> -P RunCheck.cmake
|
||||
# -DFLAGS=<file with one compiler flag per line> -DWORKDIR=<dir>
|
||||
# [-DLOAD=<clang-tidy plugin>] -P RunCheck.cmake
|
||||
|
||||
foreach(var IN ITEMS TIDY FILECHECK CHECK INPUT FLAGS WORKDIR)
|
||||
if(NOT DEFINED ${var})
|
||||
@@ -35,8 +36,12 @@ string(REGEX REPLACE "// *CHECK-[A-Z-]+:[^\n]*" "//" content "${content}")
|
||||
file(WRITE "${fixed}" "${content}")
|
||||
|
||||
file(STRINGS "${FLAGS}" flags)
|
||||
set(load)
|
||||
if(LOAD)
|
||||
set(load "--load=${LOAD}")
|
||||
endif()
|
||||
execute_process(
|
||||
COMMAND "${TIDY}" "--checks=-*,${CHECK}" --fix "${fixed}" -- ${flags}
|
||||
COMMAND "${TIDY}" ${load} "--checks=-*,${CHECK}" --fix "${fixed}" -- ${flags}
|
||||
OUTPUT_FILE "${messages}"
|
||||
ERROR_VARIABLE stderr
|
||||
RESULT_VARIABLE result
|
||||
|
||||
Reference in New Issue
Block a user