Commit ae601552 authored by Alexander Wiebel's avatar Alexander Wiebel

[CHANGE #407] make stylecheck fail if errors are detected to force correct style in CI pipeline

parent 9d5c6399
......@@ -272,7 +272,12 @@ FUNCTION( SETUP_STYLECHECKER _TargetName _CheckFiles _Excludes )
# add a new target for this lib
ADD_CUSTOM_TARGET( stylecheck_${_TargetName}
# The following COMMAND will cause printing of the errors if there are errors
# and no ouput if no errors occured (not even the number of errors, i.e. 0)
COMMAND cat ${BrainLinterListFile} | xargs ${XARGS_OPTIONS} ${PROJECT_SOURCE_DIR}/../tools/style/brainlint/brainlint.py ${STYLECHECK_OPTIONS} 2>&1 | grep -iv 'Total errors found: 0$$' | cat
# The following COMMAND will cause will produce the exit code corresponding to
# whether there have been errors (2) or not (0).
COMMAND cat ${BrainLinterListFile} | xargs ${XARGS_OPTIONS} ${PROJECT_SOURCE_DIR}/../tools/style/brainlint/brainlint.py ${STYLECHECK_OPTIONS} 2>&1 | grep -qi 'Total errors found: 0$$'
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Check if ${_TargetName} complies to CodingStandard"
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment