Fix the custom-checks script, and check for more problems
This commit is contained in:
parent
cab68cba25
commit
2f009690c3
2
Makefile
2
Makefile
@ -45,7 +45,7 @@ test: test-setup
|
|||||||
echo 'Custom warnings/errors follow:'; \
|
echo 'Custom warnings/errors follow:'; \
|
||||||
echo; \
|
echo; \
|
||||||
set -o pipefail; \
|
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; \
|
set +o pipefail; \
|
||||||
echo; \
|
echo; \
|
||||||
exit $$EXIT;
|
exit $$EXIT;
|
||||||
|
@ -51,8 +51,8 @@ check_errors() {
|
|||||||
message="$2"
|
message="$2"
|
||||||
|
|
||||||
for match in $(
|
for match in $(
|
||||||
grep --color=never -Pn "$regex" "$directory"/**/*.vim \
|
grep -n "$regex" "$directory"/**/*.vim \
|
||||||
| grep --color=never -Po '^[^:]+:[0-9]+' \
|
| grep -o '^[^:]\+:[0-9]\+' \
|
||||||
| sed 's:^\./::'
|
| sed 's:^\./::'
|
||||||
); do
|
); do
|
||||||
RETURN_CODE=1
|
RETURN_CODE=1
|
||||||
@ -65,9 +65,11 @@ if (( FIX_ERRORS )); then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
check_errors \
|
check_errors \
|
||||||
'^function.*\) *$' \
|
'^function.*) *$' \
|
||||||
'Function without abort keyword (See :help except-compat)'
|
'Function without abort keyword (See :help except-compat)'
|
||||||
check_errors ' +$' 'Trailing whitespace'
|
check_errors ' \+$' 'Trailing whitespace'
|
||||||
check_errors '^ * end?i? *$' 'Write endif, not en, end, or endi'
|
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
|
exit $RETURN_CODE
|
||||||
|
Loading…
Reference in New Issue
Block a user