From 865b402c062c7a2eab3f60d33cb46a34dbed95b3 Mon Sep 17 00:00:00 2001 From: Tinmarino Date: Tue, 16 Jun 2020 14:48:15 -0400 Subject: [PATCH] Travis: Fix vint error propagation --- autoload/vimwiki/lst.vim | 12 ++++++------ test/run_tests.sh | 22 +++++++++++----------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/autoload/vimwiki/lst.vim b/autoload/vimwiki/lst.vim index 4697e56..6b16381 100644 --- a/autoload/vimwiki/lst.vim +++ b/autoload/vimwiki/lst.vim @@ -156,7 +156,7 @@ endfunction " Remove a list item and it's children (recursive) -function! s:remove_including_children(item) +function! s:remove_including_children(item) abort let num_removed_lines = 1 let child = s:get_first_child(a:item) while child.type != 0 @@ -168,7 +168,7 @@ function! s:remove_including_children(item) endfunction -function! s:is_done(item) +function! s:is_done(item) abort return a:item.type != 0 && a:item.cb !=# '' && s:get_rate(a:item) == 100 endfunction @@ -1112,7 +1112,7 @@ endfunction " Iterate over given todo list and remove all task that are done " If recursive is true, child items will be checked too -function! s:remove_done_in_list(item, recursive) +function! s:remove_done_in_list(item, recursive) abort " Clause non-null item type if a:item.type == 0 return @@ -1150,14 +1150,14 @@ endfunction " Iterate over the list that the cursor is positioned in " and remove all lines of task that are done. " If recursive is true, child items will be checked too -function! vimwiki#lst#remove_done_in_current_list(recursive) +function! vimwiki#lst#remove_done_in_current_list(recursive) abort let item = s:get_corresponding_item(line('.')) call s:remove_done_in_list(item, a:recursive) endfunction " Remove selected lines if they contain a task that is done -function! vimwiki#lst#remove_done_in_range(first_line, last_line) +function! vimwiki#lst#remove_done_in_range(first_line, last_line) abort let first_item = s:get_corresponding_item(a:first_line) let last_item = s:get_corresponding_item(a:last_line) @@ -1196,7 +1196,7 @@ endfunction " the function has been called with a range. For older versions we use remove_done_in_range if " first and last line are identical, which means there was either no range or the range was within " one line. -function! vimwiki#lst#remove_done(recursive, range, first_line, last_line) +function! vimwiki#lst#remove_done(recursive, range, first_line, last_line) abort if a:range ==# '' let range = a:first_line != a:last_line else diff --git a/test/run_tests.sh b/test/run_tests.sh index a7a9426..89d5967 100755 --- a/test/run_tests.sh +++ b/test/run_tests.sh @@ -229,22 +229,22 @@ trap exit 1 SIGINT SIGTERM # select which tests should run case $type in "vader" ) - runVader - echo "Vader: returned $?" - o_error=$(( $? | $o_error )) + runVader ; err=$? + echo "Vader: returned $err" + o_error=$(( $err | $o_error )) ;; "vint" ) - runVint - echo "Vint: returned $?" - o_error=$(( $? | $o_error )) + runVint ; err=$? + echo "Vint: returned $err" + o_error=$(( $err | $o_error )) ;; "all" ) - runVint + runVint ; err=$? echo "Vint: returned $?" - o_error=$(( $? | $o_error )) - runVader - echo "Vader: returned $?" - o_error=$(( $? | $o_error )) + o_error=$(( $err | $o_error )) + runVader ; err=$? + echo "Vader: returned $err" + o_error=$(( $err | $o_error )) ;; * ) echo "Error: invalid type - '$type'" 1>&2