mirror of https://github.com/procxx/kepka.git
Print diff in case of clang-format output
This commit is contained in:
parent
1b9b2bbeed
commit
79367a7760
|
@ -5,6 +5,12 @@ set -x
|
||||||
cmake -G Ninja -DCMAKE_BUILD_TYPE=$BUILD_TYPE $EXTRA_CMAKE_FLAGS -DBUILD_TESTING=ON .. || exit 1
|
cmake -G Ninja -DCMAKE_BUILD_TYPE=$BUILD_TYPE $EXTRA_CMAKE_FLAGS -DBUILD_TESTING=ON .. || exit 1
|
||||||
# grep returns number of items found. each change is enclosed into <replacement>
|
# grep returns number of items found. each change is enclosed into <replacement>
|
||||||
# tag in the xml. Thus if no changes needed, 0 will be returned
|
# tag in the xml. Thus if no changes needed, 0 will be returned
|
||||||
cmake --build . --target clang-format-ci -- -v | grep -c "<replacement " && exit 1
|
cmake --build . --target clang-format -- -v
|
||||||
|
if [[ $(git diff) ]]; then
|
||||||
|
git diff | cat
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "Success!"
|
||||||
|
fi
|
||||||
cmake --build . -- -v || exit 1
|
cmake --build . -- -v || exit 1
|
||||||
ASAN_OPTIONS=alloc_dealloc_mismatch=0 ctest . || exit 1
|
ASAN_OPTIONS=alloc_dealloc_mismatch=0 ctest . || exit 1
|
||||||
|
|
|
@ -19,13 +19,6 @@ if(CLANG_FORMAT)
|
||||||
-style=file
|
-style=file
|
||||||
${ALL_CXX_SOURCE_FILES}
|
${ALL_CXX_SOURCE_FILES}
|
||||||
)
|
)
|
||||||
add_custom_target(
|
|
||||||
clang-format-ci
|
|
||||||
COMMAND clang-format
|
|
||||||
-output-replacements-xml
|
|
||||||
-style=file
|
|
||||||
${ALL_CXX_SOURCE_FILES}
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Adding clang-tidy target if executable is found
|
# Adding clang-tidy target if executable is found
|
||||||
|
|
Loading…
Reference in New Issue