Add linting/formatting and convert to module

This commit is contained in:
Joshua Boniface
2023-04-06 19:26:00 -04:00
parent ca36555e6b
commit a766f2a61f
9 changed files with 1025 additions and 158 deletions

22
format Executable file
View File

@ -0,0 +1,22 @@
#!/usr/bin/env bash
if ! which black &>/dev/null; then
echo "Black is required to format this project"
exit 1
fi
if [[ $1 == "check" ]]; then
check="--check"
fi
pushd $( git rev-parse --show-toplevel ) &>/dev/null
echo ">>> Formatting..."
black --safe ${check} .
ret=$?
if [[ $ret -eq 0 ]]; then
echo "Successfully formatted project!"
fi
popd &>/dev/null
exit $ret