AngellusMortis/sxm-player

View on GitHub
.bin/lint-code

Summary

Maintainability
Test Coverage
#!/bin/bash

BASE_DIR=$( realpath $( dirname "${BASH_SOURCE[0]}" )/../ )
source "$BASE_DIR/.bin/lib/common.sh"
setLintModules

pushd "$ROOT_PATH" 2>&1 >/dev/null

echo "Running isort..."
isort -c .
exit_code=$?
echo

echo "Running black..."
black --check .
test $? -eq 0 -a $exit_code -eq 0
exit_code=$?
echo

echo "Running flake8..."
pflake8 .
test $? -eq 0 -a $exit_code -eq 0
exit_code=$?
echo

echo "Running mypy..."
mypy .
test $? -eq 0 -a $exit_code -eq 0
exit_code=$?
echo

echo "Running bandit..."
bandit -c .bandit.yml -r $BANDIT_MODULES
test $? -eq 0 -a $exit_code -eq 0
exit_code=$?
echo

echo "Running pylint..."
pylint $PYLINT_MODULES
test $? -eq 0 -a $exit_code -eq 0
exit_code=$?
echo

popd 2>&1 >/dev/null

exit $exit_code