Skip to content

Commit

Permalink
moved clang-format command to Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
fktn-k committed Oct 9, 2023
1 parent 6b4e3ef commit 7de23f8
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 51 deletions.
14 changes: 0 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ if(FK_YAML_CODE_COVERAGE)
set(FK_YAML_BUILD_TEST ON)
endif()

if(FK_YAML_RUN_CLANG_FORMAT OR FK_YAML_CI)
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake")
endif()

if(FK_YAML_BUILD_TEST OR FK_YAML_BUILD_ALL_TEST)
set(CATCH2_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/catch2")
if(NOT EXISTS ${CATCH2_ROOT_DIR}/CMakeLists.txt)
Expand Down Expand Up @@ -78,19 +74,9 @@ target_include_directories(
${FK_YAML_TARGET_NAME} INTERFACE $<BUILD_INTERFACE:${FK_YAML_INCLUDE_BUILD_DIR}>
$<INSTALL_INTERFACE:${FK_YAML_INCLUDE_INSTALL_DIR}>)

# configure clang-format if enabled.
if(FK_YAML_RUN_CLANG_FORMAT)
set(FK_YAML_ClangFormatTargetPrefix "run_clang_format_for_")
include(RunClangFormat)
run_clang_format(${FK_YAML_TARGET_NAME} "${CMAKE_CURRENT_SOURCE_DIR}/include/fkYAML/*.hpp")
endif()

# Configure clang-tidy if enabled.
if(FK_YAML_RUN_CLANG_TIDY)
add_subdirectory(tool/clang_tidy)
if(FK_YAML_RUN_CLANG_FORMAT)
add_dependencies(ClangTidyHelper "${FK_YAML_ClangFormatTargetPrefix}${FK_YAML_TARGET_NAME}")
endif()
endif()

# Configure include-what-you-use if enabled.
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ all:

# pre-requisites: clang-format
clang-format:
cmake -B build_clang_format -S . -DFK_YAML_RUN_CLANG_FORMAT=ON
cmake --build build_clang_format --target run_clang_format
for FILE in $(SRCS) $(TEST_SRCS); do echo $$FILE; clang-format -i $$FILE; done

# pre-requisites: clang-tidy
clang-tidy:
Expand Down
27 changes: 0 additions & 27 deletions cmake/RunClangFormat.cmake

This file was deleted.

7 changes: 3 additions & 4 deletions include/fkYAML/detail/type_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ struct is_non_bool_integral : std::false_type
*/
template <typename IntegralType>
struct is_non_bool_integral<
IntegralType, enable_if_t<conjunction<
std::is_integral<IntegralType>, negation<std::is_same<bool, IntegralType>>>::value>>
IntegralType,
enable_if_t<conjunction<std::is_integral<IntegralType>, negation<std::is_same<bool, IntegralType>>>::value>>
: std::true_type
{
};
Expand Down Expand Up @@ -381,8 +381,7 @@ struct is_compatible_type_impl : std::false_type
template <typename BasicNodeType, typename CompatibleType>
struct is_compatible_type_impl<
BasicNodeType, CompatibleType,
enable_if_t<
conjunction<is_complete_type<CompatibleType>, has_to_node<BasicNodeType, CompatibleType>>::value>>
enable_if_t<conjunction<is_complete_type<CompatibleType>, has_to_node<BasicNodeType, CompatibleType>>::value>>
: std::true_type
{
};
Expand Down
4 changes: 0 additions & 4 deletions test/unit_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ catch_discover_tests(${TEST_TARGET})

add_dependencies(${TEST_TARGET} ${FK_YAML_TARGET_NAME})

if(${FK_YAML_RUN_CLANG_FORMAT})
run_clang_format(${TEST_TARGET} "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
endif()

if(FK_YAML_RUN_VALGRIND)
find_program(MEMORYCHECK_COMMAND valgrind REQUIRED)
set(MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --leak-check=full --error-exitcode=1")
Expand Down

0 comments on commit 7de23f8

Please sign in to comment.