Skip to content

Commit ef830f0

Browse files
Add typechecking script.
1 parent 54fb4f9 commit ef830f0

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

scripts/typecheck

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/usr/bin/env bash
2+
3+
4+
#
5+
# NAVIGATE TO CORRECT DIRECTORY
6+
#
7+
8+
# start by going to script dir so all movements
9+
# from here are relative
10+
SCRIPT_DIR=`dirname $(realpath "$0")`
11+
cd $SCRIPT_DIR
12+
13+
14+
function check {
15+
cd ..
16+
# enable app virtual environment
17+
eval "$(direnv export bash)"
18+
if [ !$PYTHONPATH ]; then
19+
export PYTHONPATH=$PWD
20+
fi
21+
echo ""
22+
23+
echo ""
24+
echo "Starting type checks..."
25+
echo ""
26+
27+
echo "Checking ./db_wrapper..."
28+
echo ""
29+
mypy db_wrapper
30+
mypy_src_result=$?
31+
32+
if [ $mypy_src_result != 0 ]; then
33+
echo "Error in typechecking, see output above."
34+
exit $mypy_src_result
35+
fi
36+
37+
38+
echo ""
39+
echo "Checking ./tests..."
40+
echo ""
41+
mypy tests
42+
mypy_tests_result=$?
43+
44+
if [ $mypy_tests_result != 0 ]; then
45+
echo "Error in typechecking, see output above."
46+
exit $mypy_tests_result
47+
fi
48+
49+
# return to scripts directory
50+
cd $SCRIPT_DIR
51+
echo ""
52+
}
53+
54+
check

0 commit comments

Comments
 (0)