Make errors from LDoc fatal

Via this commit, any warnings from LDoc are fatal and make "make" fail. The
intention is to cause failures on Travis for PRs that introduce broken
documentation.

Closes: https://github.com/awesomeWM/awesome/issues/643

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2016-01-30 10:43:58 +01:00
parent ad4c62e639
commit 4c8128eaa9
1 changed files with 5 additions and 1 deletions

View File

@ -259,8 +259,12 @@ if(GENERATE_DOC)
file(GLOB_RECURSE AWE_LUA_FILES ${BUILD_DIR}/lib/*.lua)
file(GLOB_RECURSE AWE_MD_FILES ${AWE_DOC_DIR}/*.md)
# Run ldoc and make it fail if any warnings are generated. The
# redirection-magic swaps stdout and stderr and awk exits with a non-zero
# status if it sees at least one line of input.
# All together, this fails as soon as ldoc prints on stderr.
add_custom_target(ldoc ALL
COMMAND ${LDOC_EXECUTABLE} .
COMMAND ${LDOC_EXECUTABLE} . 3>&1 1>&2 2>&3 | awk "{ fail=1 \; print } END { exit fail }"
WORKING_DIRECTORY ${AWE_DOC_DIR}
DEPENDS ${AWE_LUA_FILES} ${AWE_MD_FILES})
endif()