diff options
author | w0rp <devw0rp@gmail.com> | 2017-04-15 12:52:25 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-04-15 12:52:25 +0100 |
commit | 2f009690c3cf442f828830cc1d2fece619f308ff (patch) | |
tree | 5df599ac6272bb650c0608ecc70752abad8cd92d | |
parent | cab68cba250fb81a4d20ffd637925a708bb46e8a (diff) | |
download | ale-2f009690c3cf442f828830cc1d2fece619f308ff.zip |
Fix the custom-checks script, and check for more problems
-rw-r--r-- | Makefile | 2 | ||||
-rwxr-xr-x | custom-checks | 12 |
2 files changed, 8 insertions, 6 deletions
@@ -45,7 +45,7 @@ test: test-setup echo 'Custom warnings/errors follow:'; \ echo; \ set -o pipefail; \ - docker run -a stdout $(DOCKER_FLAGS) /testplugin/custom-checks /testplugin | sed s:^/testplugin/:: || EXIT=$$?; \ + docker run -v $(PWD):/testplugin "$(IMAGE)" /testplugin/custom-checks /testplugin | sed s:^/testplugin/:: || EXIT=$$?; \ set +o pipefail; \ echo; \ exit $$EXIT; diff --git a/custom-checks b/custom-checks index bdf37164..ee7cdea6 100755 --- a/custom-checks +++ b/custom-checks @@ -51,8 +51,8 @@ check_errors() { message="$2" for match in $( - grep --color=never -Pn "$regex" "$directory"/**/*.vim \ - | grep --color=never -Po '^[^:]+:[0-9]+' \ + grep -n "$regex" "$directory"/**/*.vim \ + | grep -o '^[^:]\+:[0-9]\+' \ | sed 's:^\./::' ); do RETURN_CODE=1 @@ -65,9 +65,11 @@ if (( FIX_ERRORS )); then fi check_errors \ - '^function.*\) *$' \ + '^function.*) *$' \ 'Function without abort keyword (See :help except-compat)' -check_errors ' +$' 'Trailing whitespace' -check_errors '^ * end?i? *$' 'Write endif, not en, end, or endi' +check_errors ' \+$' 'Trailing whitespace' +check_errors '^ * end\?i\? *$' 'Write endif, not en, end, or endi' +check_errors '^ [^ ]' 'Use four spaces, not two spaces' +check_errors $'\t' 'Use four spaces, not tabs' exit $RETURN_CODE |