diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2022-06-13 03:49:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-12 18:49:38 -0700 |
commit | dd8b6094c03362cc60d627ce709a4a0f9825b86a (patch) | |
tree | 50f68793cc0cb70175f8e9a6bc7896b00585f3d0 /cmake | |
parent | e420cd6c67a0aad5b5dcb40748f733876e66a2c3 (diff) | |
download | rneovim-dd8b6094c03362cc60d627ce709a4a0f9825b86a.tar.gz rneovim-dd8b6094c03362cc60d627ce709a4a0f9825b86a.tar.bz2 rneovim-dd8b6094c03362cc60d627ce709a4a0f9825b86a.zip |
build(lint): fix lintuncrustify #18945
Problem:
lintuncrustify doesn't actually do anything.
Solution:
- Fix the parameters.
- Fail correctly on nonzero result.
followup to #18940
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/RunUncrustify.cmake | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/cmake/RunUncrustify.cmake b/cmake/RunUncrustify.cmake index 9ebbd6b77c..7f5e2a34f4 100644 --- a/cmake/RunUncrustify.cmake +++ b/cmake/RunUncrustify.cmake @@ -1,5 +1,16 @@ # HACK: This script is invoked with "cmake -P …" as a workaround to silence uncrustify. +# Split space-separated string into a cmake list, so that execute_process() +# will pass each file as individual arg to uncrustify. +string(REPLACE " " ";" NVIM_SOURCES ${NVIM_SOURCES}) +string(REPLACE " " ";" NVIM_HEADERS ${NVIM_HEADERS}) + execute_process( - COMMAND ${UNCRUSTIFY_PRG} -c "${PROJECT_SOURCE_DIR}/src/uncrustify.cfg" -q --check ${LINT_NVIM_SOURCES} - OUTPUT_QUIET) + COMMAND ${UNCRUSTIFY_PRG} -c "${PROJECT_SOURCE_DIR}/src/uncrustify.cfg" -q --check ${NVIM_SOURCES} ${NVIM_HEADERS} + OUTPUT_VARIABLE crusty_out + ERROR_VARIABLE crusty_err + RESULT_VARIABLE crusty_res) + +if(NOT crusty_res EQUAL 0) + message(FATAL_ERROR "crusty: ${crusty_res} ${crusty_err}") +endif() |