Skip to content

Commit

Permalink
coding-style-check: Skip if clang-format not found (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
phako authored and andreasebner committed Apr 24, 2023
1 parent 8fce475 commit 260e941
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmake/check-coding-style.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ if which clang-format-14 > /dev/null; then
echo "Code formatting incorrect!"
fi
else
echo 77 > "${ERRFILE}"
echo "WARNING: clang-format-14 not found, code formatting not checked!"
fi

Expand Down
3 changes: 3 additions & 0 deletions cmake/enable_code_style_check.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@
enable_testing()
add_test(NAME coding_style COMMAND ${CMAKE_SOURCE_DIR}/cmake/check-coding-style.sh ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})

# coding style will return 77 if no clang-format-14 could be found AND none of the other tests fail
set_property(TEST coding_style PROPERTY SKIP_RETURN_CODE 77)

0 comments on commit 260e941

Please sign in to comment.