-
Notifications
You must be signed in to change notification settings - Fork 0
/
run
executable file
·69 lines (58 loc) · 938 Bytes
/
run
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env bash
set -euo pipefail
THISDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
function help(){
cat << EOF
census-tools
help : Display help text
restore : Fetch dependencies
dev : Spawn a notebook server
lint : Lint codebase
unit : Run unit tests
integration : Run integration tests
EOF
}
function run_restore(){
pipenv install --dev
}
function run_dev(){
pipenv run jupyter lab
}
function run_lint(){
pipenv run mypy "$THISDIR"/census_tools/
pipenv run pylint "$THISDIR"/census_tools/
}
function run_unit(){
pipenv run pytest
}
function run_integration(){
echo "Not implemented."
}
function main(){
cmd=${1-default}
shift || true
case "$cmd" in
help)
help "$@"
;;
restore)
run_restore
;;
dev)
run_dev
;;
lint)
run_lint
;;
unit)
run_unit
;;
integration)
run_integration
;;
*)
echo "no-op $cmd"
;;
esac
}
main "$@"