]> git.scottworley.com Git - pinch/blob - test.sh
5df81bfee091044ea4d44c23627e3ab5fca8afb7
[pinch] / test.sh
1 #!/bin/sh
2
3 set -e
4
5 PARALLELISM=4
6
7 find . -name build -prune -o -name dist -prune -o -name '*.py' -print0 |
8 xargs -0 mypy --strict --ignore-missing-imports
9
10 for test in tests/*;do
11 if [ ! -d "$test" ];then
12 "$test"
13 fi
14 done
15
16 find . -name '*_test.py' -print0 | xargs -0 -r -n1 python3
17
18 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
19
20 formatting_needs_fixing=$(
21 find . -name '*.py' -print0 |
22 xargs -P "$PARALLELISM" -0 -n1 autopep8 --diff -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
23 )
24 if [[ "$formatting_needs_fixing" ]];then
25 echo "Formatting needs fixing:"
26 echo "$formatting_needs_fixing"
27 exit 1
28 fi