mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-26 21:09:08 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user