aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2022-07-04 13:56:54 +0100
committerLewis Russell <lewis6991@gmail.com>2022-07-04 14:20:10 +0100
commit5b609bbefbd6aa237b187901f68723014c9abf78 (patch)
treeb8f3325de59f75f59aebd92dafc4e25d5e506dcb
parentab5929e1b0f13b8750c8a97d41396ac9a0769e18 (diff)
downloadrneovim-5b609bbefbd6aa237b187901f68723014c9abf78.tar.gz
rneovim-5b609bbefbd6aa237b187901f68723014c9abf78.tar.bz2
rneovim-5b609bbefbd6aa237b187901f68723014c9abf78.zip
build: add github action annotations for clint
-rwxr-xr-xsrc/clint.py5
-rwxr-xr-xsrc/nvim/CMakeLists.txt10
2 files changed, 12 insertions, 3 deletions
diff --git a/src/clint.py b/src/clint.py
index 944946bd16..28f6031a57 100755
--- a/src/clint.py
+++ b/src/clint.py
@@ -651,6 +651,9 @@ def Error(filename, linenum, category, confidence, message):
elif _cpplint_state.output_format == 'eclipse':
sys.stdout.write('%s:%s: warning: %s [%s] [%d]\n' % (
filename, linenum, message, category, confidence))
+ elif _cpplint_state.output_format == 'gh_action':
+ sys.stdout.write('::error file=%s,line=%s::%s [%s] [%d]\n' % (
+ filename, linenum, message, category, confidence))
else:
sys.stdout.write('%s:%s: %s [%s] [%d]\n' % (
filename, linenum, message, category, confidence))
@@ -3053,7 +3056,7 @@ def ParseArguments(args):
if opt == '--help':
PrintUsage(None)
elif opt == '--output':
- if val not in ('emacs', 'vs7', 'eclipse'):
+ if val not in ('emacs', 'vs7', 'eclipse', 'gh_action'):
PrintUsage('The only allowed output formats are emacs,'
' vs7 and eclipse.')
output_format = val
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt
index a0b8f16a39..de4af8e77b 100755
--- a/src/nvim/CMakeLists.txt
+++ b/src/nvim/CMakeLists.txt
@@ -778,6 +778,12 @@ add_custom_command(
add_download(${LINT_SUPPRESS_FILE} ${LINT_SUPPRESS_URL} off)
+if(CI_BUILD)
+ set(LINT_OUTPUT_FORMAT gh_action)
+else()
+ set(LINT_OUTPUT_FORMAT vs7)
+endif()
+
set(LINT_NVIM_REL_SOURCES)
foreach(sfile ${LINT_NVIM_SOURCES})
get_test_target("" "${sfile}" r suffix)
@@ -787,7 +793,7 @@ foreach(sfile ${LINT_NVIM_SOURCES})
set(touch_file "${TOUCHES_DIR}/ran-clint-${suffix}")
add_custom_command(
OUTPUT ${touch_file}
- COMMAND ${LINT_PRG} --suppress-errors=${suppress_file} ${rsfile}
+ COMMAND ${LINT_PRG} --suppress-errors=${suppress_file} --output=${LINT_OUTPUT_FORMAT} ${rsfile}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMAND ${CMAKE_COMMAND} -E touch ${touch_file}
DEPENDS ${LINT_PRG} ${sfile} ${LINT_SUPPRESSES_TOUCH_FILE}
@@ -807,7 +813,7 @@ add_glob_targets(
add_custom_target(
lintcfull
COMMAND
- ${LINT_PRG} --suppress-errors=${LINT_SUPPRESS_FILE} ${LINT_NVIM_REL_SOURCES}
+ ${LINT_PRG} --suppress-errors=${LINT_SUPPRESS_FILE} --output=${LINT_OUTPUT_FORMAT} ${LINT_NVIM_REL_SOURCES}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
DEPENDS ${LINT_PRG} ${LINT_NVIM_SOURCES} ${LINT_SUPPRESS_FILE} lintuncrustify
)