Improve ALE project style checking

* The project style linter now runs while you type.
* Now the scripts for checking the project require blank lines.
* Many style issues have been found and fixed.
This commit is contained in:
w0rp
2018-09-04 16:51:18 +01:00
parent 8f2e1c393f
commit d476578a40
69 changed files with 239 additions and 41 deletions

View File

@@ -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