tubearchivist-metrics/deploy.sh

32 lines
688 B
Bash
Raw Normal View History

2022-04-14 20:58:31 +00:00
#!/bin/bash
function validate {
if [[ $1 ]]; then
check_path="$1"
else
check_path="."
fi
echo "run validate on $check_path"
echo "running black"
black --diff --color --check -l 79 "$check_path"
echo "running codespell"
codespell --skip="./.git" "$check_path"
echo "running flake8"
flake8 "$check_path" --count --max-complexity=10 --max-line-length=79 \
--show-source --statistics
echo "running isort"
isort --check-only --diff --profile black -l 79 "$check_path"
printf " \n> all validations passed\n"
}
if [[ $1 == "validate" ]]; then
validate
else
echo "valid options are: validate"
2022-04-14 20:58:31 +00:00
fi
exit 0