diff options
Diffstat (limited to 'test/script/custom-linting-rules')
-rwxr-xr-x | test/script/custom-linting-rules | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/test/script/custom-linting-rules b/test/script/custom-linting-rules index 7aafe995..77e87db4 100755 --- a/test/script/custom-linting-rules +++ b/test/script/custom-linting-rules @@ -60,10 +60,10 @@ check_errors() { for directory in "${directories[@]}"; do # shellcheck disable=SC2086 - while IFS= read -r match; do + while read -r; do RETURN_CODE=1 - echo "$match $message" - done < <(grep -n "$regex" $include_arg "$directory"/**/*.vim \ + echo "$REPLY $message" + done < <(grep -H -n "$regex" $include_arg "$directory"/**/*.vim \ | grep -v 'no-custom-checks' \ | grep -o '^[^:]\+:[0-9]\+' \ | sed 's:^\./::') @@ -126,4 +126,13 @@ check_errors '\(!=.\?\|isnot\) type(\[\])' "Use 'isnot v:t_list' instead" check_errors '\(!=.\?\|isnot\) type({})' "Use 'isnot v:t_dict' instead" check_errors '\(!=.\?\|isnot\) type(function([^)]\+))' "Use 'isnot v:t_func' instead" +# Run a Python script to find lines that require padding around them. For +# users without Python installed, we'll skip these checks. Travis CI will run +# the script. +if command -v python > /dev/null; then + if ! test/script/block-padding-checker "$directory"/**/*.vim; then + RETURN_CODE=1 + fi +fi + exit $RETURN_CODE |