mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
ci: Use error suppression in place of ignored files list. #3185
Fixes #3174
This commit is contained in:
@@ -1,18 +1,27 @@
|
||||
get_filename_component(LINT_DIR ${LINT_DIR} ABSOLUTE)
|
||||
get_filename_component(LINT_PREFIX ${LINT_DIR} PATH)
|
||||
set(LINT_SUPPRESS_FILE "${LINT_PREFIX}/errors.json")
|
||||
|
||||
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})
|
||||
foreach(ignore_file ${LINT_IGNORED_FILES})
|
||||
list(REMOVE_ITEM LINT_FILES "${LINT_PREFIX}/${ignore_file}")
|
||||
endforeach()
|
||||
set(LINT_ARGS)
|
||||
|
||||
if(LINT_SUPPRESS_URL)
|
||||
file(DOWNLOAD ${LINT_SUPPRESS_URL} ${LINT_SUPPRESS_FILE})
|
||||
list(APPEND LINT_ARGS "--suppress-errors=${LINT_SUPPRESS_FILE}")
|
||||
endif()
|
||||
|
||||
foreach(lint_file ${LINT_FILES})
|
||||
file(RELATIVE_PATH lint_file "${LINT_PREFIX}" "${lint_file}")
|
||||
list(APPEND LINT_ARGS "${lint_file}")
|
||||
endforeach()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${LINT_PRG} ${LINT_FILES}
|
||||
RESULT_VARIABLE res)
|
||||
COMMAND ${LINT_PRG} ${LINT_ARGS}
|
||||
RESULT_VARIABLE res
|
||||
WORKING_DIRECTORY "${LINT_PREFIX}")
|
||||
|
||||
file(REMOVE ${LINT_SUPPRESS_FILE})
|
||||
|
||||
if(NOT res EQUAL 0)
|
||||
message(FATAL_ERROR "Linting failed: ${res}.")
|
||||
|
||||
Reference in New Issue
Block a user