mirror of
https://github.com/tubearchivist/tubearchivist-metrics.git
synced 2024-12-22 01:40:14 +00:00
Adding in deploy.sh with validation function.
This commit is contained in:
parent
f6dfce00d9
commit
fff038b945
30
deploy.sh
Normal file
30
deploy.sh
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
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"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
if [[ $1 == "validate" ]]; then
|
||||||
|
validate
|
||||||
|
else
|
||||||
|
echo "valid options are: validate"
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user