diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2014-12-24 00:34:00 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-12-24 00:34:00 -0500 |
commit | 11a3eba72c2a527aab48ba553165e71d6d9507fa (patch) | |
tree | 954ac1472c824b97e75b49cd79e07a05aeda5065 /cmake | |
parent | aa08632caf80d2259d94e8f6e30cd806e3c05a1d (diff) | |
parent | ed9828140a343145e247a76e175912dcd785899d (diff) | |
download | rneovim-11a3eba72c2a527aab48ba553165e71d6d9507fa.tar.gz rneovim-11a3eba72c2a527aab48ba553165e71d6d9507fa.tar.bz2 rneovim-11a3eba72c2a527aab48ba553165e71d6d9507fa.zip |
Merge #1493: enable linting by default
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/RunLint.cmake | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cmake/RunLint.cmake b/cmake/RunLint.cmake new file mode 100644 index 0000000000..35d3f942aa --- /dev/null +++ b/cmake/RunLint.cmake @@ -0,0 +1,21 @@ +get_filename_component(LINT_DIR ${LINT_DIR} ABSOLUTE) +get_filename_component(LINT_PREFIX ${LINT_DIR} PATH) +file(GLOB_RECURSE LINT_FILES ${LINT_DIR}/*.c ${LINT_DIR}/*.h) + +if(LINT_IGNORE_FILE) + file(READ ${LINT_IGNORE_FILE} LINT_IGNORED_FILES) + string(REPLACE "\n" ";" LINT_IGNORED_FILES ${LINT_IGNORED_FILES}) + message(STATUS "Ignoring the following files for linting:") + foreach(ignore_file ${LINT_IGNORED_FILES}) + message(STATUS "${ignore_file}") + list(REMOVE_ITEM LINT_FILES "${LINT_PREFIX}/${ignore_file}") + endforeach() +endif() + +execute_process( + COMMAND ${LINT_PRG} ${LINT_FILES} + RESULT_VARIABLE res) + +if(NOT res EQUAL 0) + message(FATAL_ERROR "Linting failed: ${res}.") +endif() |