-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·36 lines (28 loc) · 1.04 KB
/
test.sh
File metadata and controls
executable file
·36 lines (28 loc) · 1.04 KB
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
#!/bin/bash
RED='\033[0;31m'
GREEN='\033[0;32m'
RESET='\033[0m'
AT_LEAST_ONE_ERROR=0
function capture_stdout_and_stderr_if_successful {
set +e
COMMAND=$*
printf "Running %s ... " "${COMMAND}"
if ! OUTPUT=$($COMMAND 2>&1); then
AT_LEAST_ONE_ERROR=1
printf "%bFailed%b\n" "${RED}" "${RESET}"
printf "%s\n\n" "${OUTPUT}"
else
printf "%bSuccess!%b\n" "${GREEN}" "${RESET}"
fi
set -e
}
export DJANGO_SETTINGS_MODULE=config.settings.local
export PYTHONPATH=chrisdoescoding
export MYPYPATH=chrisdoescoding/stubs
capture_stdout_and_stderr_if_successful mypy chrisdoescoding --no-incremental
capture_stdout_and_stderr_if_successful flake8 chrisdoescoding --count
capture_stdout_and_stderr_if_successful isort -rc chrisdoescoding --check-only
capture_stdout_and_stderr_if_successful black chrisdoescoding --check
capture_stdout_and_stderr_if_successful python chrisdoescoding/manage.py makemigrations --check
capture_stdout_and_stderr_if_successful python chrisdoescoding/manage.py test
exit $AT_LEAST_ONE_ERROR