]>
Commit | Line | Data |
---|---|---|
bef7ce53 SW |
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 | | |
f36d5c6f | 8 | xargs -0 mypy --strict --ignore-missing-imports --no-warn-unused-ignores --allow-untyped-decorators |
bef7ce53 SW |
9 | |
10 | python3 -m unittest | |
11 | ||
12 | if [ "$1" = lint ];then | |
13 | ||
14 | find . -name '*.py' -print0 | xargs -0 pylint --reports=n --persistent=n --ignore-imports=y -d invalid-name,missing-docstring | |
15 | ||
16 | formatting_needs_fixing=$( | |
17 | find . -name '*.py' -print0 | | |
18 | xargs -P "$PARALLELISM" -0 -n1 autopep8 --diff -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | |
19 | ) | |
20 | if [[ "$formatting_needs_fixing" ]];then | |
21 | echo "Formatting needs fixing:" | |
22 | echo "$formatting_needs_fixing" | |
23 | exit 1 | |
24 | fi | |
25 | ||
26 | fi |