2017-08-05 21:04:38 +00:00
|
|
|
#!/bin/bash
|
2017-06-01 11:40:33 +00:00
|
|
|
# Lint checker/fixer
|
2017-08-05 21:04:38 +00:00
|
|
|
# This script is deprecated, but still works.
|
2017-06-01 11:40:33 +00:00
|
|
|
|
2017-08-05 21:04:38 +00:00
|
|
|
function auto_fix() {
|
|
|
|
./dev.py fix && ./dev.py isort
|
2017-06-01 11:40:33 +00:00
|
|
|
}
|
|
|
|
|
2017-08-05 21:04:38 +00:00
|
|
|
|
2017-06-01 11:40:33 +00:00
|
|
|
function check_lint() {
|
2017-08-05 21:04:38 +00:00
|
|
|
./dev.py lint
|
2017-06-01 11:40:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# MAIN
|
2017-08-05 21:04:38 +00:00
|
|
|
action=auto_fix # default action
|
2017-06-01 11:40:33 +00:00
|
|
|
for arg in "$@"
|
|
|
|
do
|
|
|
|
case "$arg" in
|
|
|
|
"-h" | "--help")
|
2017-08-05 21:04:38 +00:00
|
|
|
echo "+ ========================= +"
|
|
|
|
echo "+ This script is deprecated +"
|
|
|
|
echo "+ Please use ./dev.py +"
|
|
|
|
echo "+ ========================= +"
|
|
|
|
echo ""
|
2017-06-01 11:40:33 +00:00
|
|
|
echo "Lint checker/fixer"
|
|
|
|
echo ""
|
|
|
|
echo "Usage: $0 [-c|--check] [-h|--help]"
|
|
|
|
echo " No arguments : Check and auto-fix some warnings/errors"
|
|
|
|
echo " -c | --check : only check lint (don't auto-fix)"
|
|
|
|
echo " -h | --help : show this help and exit"
|
|
|
|
exit 0;
|
|
|
|
;;
|
|
|
|
"-c" | "--check")
|
|
|
|
action=check_lint
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
${action} # run selected action
|
2017-08-05 21:04:38 +00:00
|
|
|
if [[ $? -ne 0 ]]; then exit 1; fi
|