File: complexity.sh

package info (click to toggle)
python-plugwise 1.10.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,228 kB
  • sloc: xml: 92,898; python: 5,378; sh: 324; makefile: 2
file content (25 lines) | stat: -rwxr-xr-x 698 bytes parent folder | download
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