-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun
executable file
·41 lines (32 loc) · 829 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
#!/bin/bash
usage=()
usage+=(" $0 tests - run tests")
tests() {
poetry run pytest
lint
}
usage+=(" $0 refmt - reformat code")
refmt() {
poetry run isort opentracing_compose/**.py tests/**.py
poetry run black opentracing_compose tests
}
usage+=(" $0 lint - run linting")
lint() {
poetry run flake8 opentracing_compose tests
poetry run mypy opentracing_compose/**.py tests/**.py
poetry run black --check opentracing_compose tests
poetry run isort --check-only opentracing_compose/**.py tests/**.py
}
usage+=(" $0 bump2version {major|minor|patch} - bump version number")
bump2version() {
poetry run bump2version "$@"
}
cmd=$1
shift
if ! declare -f "$cmd" >/dev/null; then
echo "Usage:"
for line in "${usage[@]}"; do echo "$line"; done
exit 1
fi
set -o xtrace
"$cmd" "$@"