From d6d065bcb054ed25f6751608ac05c41754797647 Mon Sep 17 00:00:00 2001 From: Daniel <d.hornung@indiscale.com> Date: Wed, 25 Sep 2024 17:04:47 +0200 Subject: [PATCH] ENH: Explicit dependency on clang-tidy-16, and checks. See !92 for the relevant issue. --- .docker/Dockerfile | 2 +- CMakeLists.txt | 4 ++-- Makefile | 8 +++++--- doc/DEPENDENCIES.md | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.docker/Dockerfile b/.docker/Dockerfile index f0d5c54..575f232 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -4,7 +4,7 @@ RUN apt-get update RUN apt-get install -y cmake RUN apt-get install -y lcov RUN apt-get install -y doxygen graphviz -RUN apt-get install -y clang-format-16 clang-tidy +RUN apt-get install -y clang-format-16 clang-tidy-16 RUN apt-get install -y python3-pip python3-venv RUN apt-get install -y git RUN apt-get install -y curl zip unzip tar diff --git a/CMakeLists.txt b/CMakeLists.txt index 7556d30..a47734c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -320,7 +320,7 @@ if(_LINTING) ) endif() - find_program(clang_tidy NAMES clang-tidy clang-tidy-11) + find_program(clang_tidy NAMES clang-tidy clang-tidy-16) if(NOT clang_tidy) message(WARNING "clang-tidy: Not found") else() @@ -439,7 +439,7 @@ install(FILES ${PROJECT_SOURCE_DIR}/linkaheadConfigVersion.cmake ####################################################### option(AUTOFORMATTING "call clang-format at configure time" ON) if(AUTOFORMATTING AND NOT SKIP_LINTING) - find_program(clang_format NAMES clang-format-11 clang-format) + find_program(clang_format NAMES clang-format-16 clang-format) file(GLOB format_test_sources test/*.cpp test/*.h test/*.h.in) execute_process(COMMAND ${clang_format} -i --verbose ${liblinkahead_INCL} ${liblinkahead_SRC} ${liblinkahead_TEST_SRC} diff --git a/Makefile b/Makefile index d807cfa..707209c 100644 --- a/Makefile +++ b/Makefile @@ -58,7 +58,6 @@ help: @echo " test-debug - Install dependencies, build the project in Debug mode, and run the tests." @echo " test-release - Install dependencies, build the project in Release mode, and run the tests." @echo " clean - Remove build directory." - style: $(CLANG_FORMAT) -i --verbose \ @@ -105,6 +104,9 @@ conan-build: .PHONY: conan-build conan-build-debug: + @command -v lcov || (echo "Could not find 'lcov', exiting."; exit 1) + @command -v clang-tidy || command -v clang-tidy-16 || \ + (echo "Could not find 'clang-tidy'(-16), exiting."; exit 1) conan build . -s $(CONAN_SETTINGS) -s build_type=Debug .PHONY: conan-build-debug @@ -134,7 +136,7 @@ test-debug: conan-install-debug conan-build-debug ctest-debug test-release: conan-install-deps conan-build ctest-release .PHONY: test-release - + clean: rm -rf build -.PHONY: clean \ No newline at end of file +.PHONY: clean diff --git a/doc/DEPENDENCIES.md b/doc/DEPENDENCIES.md index dbbd559..bcdd9e1 100644 --- a/doc/DEPENDENCIES.md +++ b/doc/DEPENDENCIES.md @@ -32,7 +32,7 @@ python packages from the `doc/requirements.txt` file ## Build and run tests ## ``` ->=clang-tidy-11 +clang-tidy-16 >=gtest-1.10.0 ``` -- GitLab