]> git.scottworley.com Git - pinch/blame - test.sh
Fix a bash-ism in test.sh, which is #!/bin/sh
[pinch] / test.sh
CommitLineData
2f96f32a
SW
1#!/bin/sh
2
3set -e
4
5PARALLELISM=4
6
b365b524 7find . -name build -prune -o -name dist -prune -o -name '*.py' -print0 |
7c4de64c 8 xargs -0 mypy --strict --ignore-missing-imports --no-warn-unused-ignores
2f96f32a 9
49d58bdf 10for test in tests/*;do
a2290fb1 11 if [ ! -d "$test" ];then
e79a920c 12 echo "### Running test $test" >&2
a2290fb1
SW
13 "$test"
14 fi
49d58bdf
SW
15done
16
2f96f32a
SW
17find . -name '*_test.py' -print0 | xargs -0 -r -n1 python3
18
420bd8c9
SW
19if [ "$1" = lint ];then
20
21 find . -name '*.py' -print0 | xargs -0 pylint --reports=n --persistent=n --ignore-imports=y -d fixme,invalid-name,missing-docstring,subprocess-run-check,too-few-public-methods
22
23 formatting_needs_fixing=$(
24 find . -name '*.py' -print0 |
25 xargs -P "$PARALLELISM" -0 -n1 autopep8 --diff -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
26 )
76fea05b 27 if [ -n "$formatting_needs_fixing" ];then
420bd8c9
SW
28 echo "Formatting needs fixing:"
29 echo "$formatting_needs_fixing"
30 exit 1
31 fi
32
2f96f32a 33fi