]> git.scottworley.com Git - rfc1751/blame - test.sh
Inline "encode"
[rfc1751] / test.sh
CommitLineData
27ff981f
SW
1#!/bin/sh
2
3set -e
4
5find . -name build -prune -o -name dist -prune -o -name '*.py' -print0 |
6 xargs -0 mypy --strict --ignore-missing-imports --no-warn-unused-ignores
7
8find . -name '*_test.py' -print0 | xargs -0 -r -n1 python3
9
10for test in tests/*;do
11 if [ ! -d "$test" ];then
12 echo "### Running test $test" >&2
13 if ! "$test";then
14 echo "Test $test failed" >&2
15 exit 1
16 fi
17 fi
18done
19
20if [ "$1" = lint ];then
21
22 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
23
24 formatting_needs_fixing=$(
25 find . -name '*.py' -print0 |
26 xargs -0 -n1 autopep8 --diff -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
27 )
28 if [ -n "$formatting_needs_fixing" ];then
29 echo "Formatting needs fixing:"
30 echo "$formatting_needs_fixing"
31 exit 1
32 fi
33
34fi