From 641d20666403b6ea2b8ccbcd4640481c2b641e20 Mon Sep 17 00:00:00 2001 From: Antoine Gouby Date: Sun, 4 Feb 2024 23:49:28 +0100 Subject: [PATCH] test bad format --- .github/workflows/build.yml | 2 +- CMakeLists.txt | 1 - cmake/format.cmake | 19 ------------------- scripts/format.sh | 10 +++++----- source/core/interface.hxx | 2 +- 5 files changed, 7 insertions(+), 27 deletions(-) delete mode 100644 cmake/format.cmake diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bc3b374..e3a0dfb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: - name: Format run: | - ./scripts/format.sh + ./scripts/format.sh --check build: runs-on: ubuntu-latest diff --git a/CMakeLists.txt b/CMakeLists.txt index 4023e20..d2ce793 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,6 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) include(cmake/compiler.cmake) -include(cmake/format.cmake) include(cmake/lib.cmake) find_package(spdlog REQUIRED) diff --git a/cmake/format.cmake b/cmake/format.cmake deleted file mode 100644 index d85a8dd..0000000 --- a/cmake/format.cmake +++ /dev/null @@ -1,19 +0,0 @@ -find_program(CLANG_FORMAT "clang-format" REQUIRED) - -file(GLOB_RECURSE ALL_SOURCE_FILES - ${CMAKE_SOURCE_DIR}/source/*.cxx - ${CMAKE_SOURCE_DIR}/source/*.hxx - ${CMAKE_SOURCE_DIR}/include/*.hxx - ${CMAKE_SOURCE_DIR}/examples/*.cxx - ${CMAKE_SOURCE_DIR}/examples/*.hxx -) - -add_custom_target(format - COMMAND ${CLANG_FORMAT} --style=file -i ${ALL_SOURCE_FILES} - COMMENT "Running clang-format on all source files" -) - -add_custom_target(format-check - COMMAND ${CLANG_FORMAT} --style=file -output-replacements-xml ${ALL_SOURCE_FILES} | grep \" /dev/null && echo "Error! Code is not well formatted." && exit 1 || echo "Format OK" && exit 0 diff --git a/source/core/interface.hxx b/source/core/interface.hxx index 3ba6c69..022963b 100644 --- a/source/core/interface.hxx +++ b/source/core/interface.hxx @@ -35,7 +35,7 @@ struct itf_impl { int send_message(const nlohmann::json &data); itf_info info; - std::string topic_base; + std::string topic_base; std::string topic_cmd; mqtt_service *mqtt; std::unordered_map attributes;