aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2026-10-26 20:19:19 +0100
committerFelix Morgner <felix.morgner@gmail.com>2026-10-26 20:19:19 +0100
commit0304a0602e19b9ec4feb0d12a2cfb5a94e4cb237 (patch)
tree135bcd756bfe0484c71624caf8c8d13a43d1a5ad
parentf3b1c84a29e272cc589c300bca5020ccd4685a02 (diff)
downloadttwhy-0304a0602e19b9ec4feb0d12a2cfb5a94e4cb237.tar.xz
ttwhy-0304a0602e19b9ec4feb0d12a2cfb5a94e4cb237.zip
ide: improve clang-tidy integration
-rw-r--r--.clang-tidy4
-rw-r--r--CMakeLists.txt29
2 files changed, 29 insertions, 4 deletions
diff --git a/.clang-tidy b/.clang-tidy
index 6794ba6..bf5a3a7 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -62,10 +62,6 @@ CheckOptions:
cppcoreguidelines-avoid-non-const-global-variables.AllowInternalLinkage: true
- modernize-use-std-print.ReplacementPrintFunction: "kstd::print"
- modernize-use-std-print.ReplacementPrintlnFunction: "kstd::println"
- modernize-use-std-print.PrintHeader: "kstd/print"
-
modernize-use-std-ranges.UseReversePipe: true
modernize-use-trailing-return-type.TransformLambdas: none
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bdda024..0562c1c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,6 +7,15 @@ project("ttwhy"
include("CTest")
+### System Tools
+
+find_program(CLANG_TIDY_PATH NAMES
+ "clang-tidy"
+ "clang-tidy-22"
+ "clang-tidy-23"
+ "clang-tidy-24"
+)
+
### System Dependencies
find_package("Threads")
@@ -95,6 +104,16 @@ target_compile_options("ttwhy-core" PUBLIC
"$<$<CXX_COMPILER_ID:Clang,GNU>:-pedantic-errors>"
)
+if(CLANG_TIDY_PATH)
+ set_target_properties("ttwhy-core" PROPERTIES
+ CXX_CLANG_TIDY "${CLANG_TIDY_PATH}"
+ )
+else()
+ message(AUTHOR_WARNING
+ "clang-tidy not found; skipping linting for 'ttwhy::core'"
+ )
+endif()
+
### Applications
add_executable("ttwhy-echo")
@@ -108,6 +127,16 @@ target_link_libraries("ttwhy-echo" PRIVATE
"ttwhy::lib"
)
+if(CLANG_TIDY_PATH)
+ set_target_properties("ttwhy-echo" PROPERTIES
+ CXX_CLANG_TIDY "${CLANG_TIDY_PATH}"
+ )
+else()
+ message(AUTHOR_WARNING
+ "clang-tidy not found; skipping linting for 'ttwhy::echo'"
+ )
+endif()
+
### Tests
if(BUILD_TESTING)