Skip to content
This repository was archived by the owner on Mar 21, 2022. It is now read-only.

Commit 131720d

Browse files
committed
test: exclude build dir from linting
run-tests.sh uses build for holding build and test dependencies. These shouldn't be linted since they are not under our control. Signed-off-by: Kevin Locke <[email protected]>
1 parent 185dba2 commit 131720d

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

run-tests.sh

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,21 @@
22

33
set -Ceu
44

5+
if [ $# -ne 0 ]; then
6+
echo "Usage: $0" >&2
7+
exit 1
8+
fi
9+
510
# Work from project root
611
cd "$(dirname "$0")"
712

13+
# Set dirs to lint as arguments, excluding build dir (if present)
14+
for dir in *; do
15+
if [ "$dir" != build ] && [ -d "$dir" ]; then
16+
set -- "$@" "$dir"
17+
fi
18+
done
19+
820
# Use build for build and test tools
921
mkdir -p build
1022

@@ -18,11 +30,11 @@ if ! [ -d build/vim-vimlint ]; then
1830
fi
1931

2032
# Run vimlint
21-
./build/vim-vimlint/bin/vimlint.sh -l build/vim-vimlint -p build/vim-vimlparser -v .
33+
./build/vim-vimlint/bin/vimlint.sh -l build/vim-vimlint -p build/vim-vimlparser -v "$@"
2234

2335
# Ensure vint is available, then run it
2436
if command -v vint >/dev/null; then
25-
vint -s .
37+
vint -s "$@"
2638
elif command -v python3 >/dev/null; then
2739
if ! [ -d build/venv3 ]; then
2840
python3 -m venv build/venv3
@@ -31,7 +43,7 @@ elif command -v python3 >/dev/null; then
3143
# Note: --no-binary vim-vint is used to work around Kuniwak/vint#287
3244
./build/venv3/bin/pip3 install --no-binary vim-vint
3345
fi
34-
./build/venv3/bin/vint -s .
46+
./build/venv3/bin/vint -s "$@"
3547
elif command -v virtualenv >/dev/null; then
3648
if ! [ -d build/venv2 ]; then
3749
virtualenv build/venv2
@@ -40,7 +52,7 @@ elif command -v virtualenv >/dev/null; then
4052
# Note: --no-binary vim-vint is used to work around Kuniwak/vint#287
4153
./build/venv2/bin/pip install --no-binary vim-vint
4254
fi
43-
./build/venv2/bin/vint -s .
55+
./build/venv2/bin/vint -s "$@"
4456
else
4557
echo 'Warning: Skipping vint.' >&2
4658
fi
@@ -51,4 +63,4 @@ if ! [ -d build/vader.vim ]; then
5163
fi
5264

5365
# Run Vader tests
54-
exec vim -i NONE -u test-vimrc -U NONE -V1 -nNeXs "$@" -c 'Vader! test/*.vader'
66+
exec vim -i NONE -u test-vimrc -U NONE -V1 -nNeXs -c 'Vader! test/*.vader'

0 commit comments

Comments
 (0)