From fff038b945481fc5d7d00e62f0a692555ac8c67a Mon Sep 17 00:00:00 2001 From: Ainsey11 Date: Thu, 14 Apr 2022 19:39:27 +0100 Subject: [PATCH] Adding in deploy.sh with validation function. --- deploy.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 deploy.sh diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..5eb6cd4 --- /dev/null +++ b/deploy.sh @@ -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 \ No newline at end of file