1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
#!/usr/bin/env bash
set -eu
my_path=$(git rev-parse --show-toplevel)
if [ -n "${VIRTUAL_ENV-}" ] && [ -f "${VIRTUAL_ENV}/bin/activate" ]; then
# shellcheck disable=SC1091 # ingesting virtualenv
. "${VIRTUAL_ENV}/bin/activate"
else
# other common virtualenvs
my_path=$(git rev-parse --show-toplevel)
for venv in venv .venv .; do
if [ -f "${my_path}/${venv}/bin/activate" ]; then
# shellcheck disable=SC1090 # ingesting virtualenv
. "${my_path}/${venv}/bin/activate"
break
fi
done
fi
echo "-----------------------------"
echo "Running cyclomatic complexity"
echo "-----------------------------"
PYTHONPATH=$(pwd) radon cc plugwise/ tests/ -s -nc --no-assert
|