diff --git a/.github/workflows/pythontest.yml b/.github/workflows/pythontest.yml index b60db54ea..b77aa8329 100644 --- a/.github/workflows/pythontest.yml +++ b/.github/workflows/pythontest.yml @@ -25,7 +25,7 @@ jobs: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Lint with flake8 run: | - flake8 ${{ matrix.python-code-path }} --count --select=E9,E501,F63,F7,F82,W191,W292 --show-source --max-complexity=10 --max-line-length=200 --statistics --doctests + flake8 ${{ matrix.python-code-path }} --show-source --max-complexity=10 --doctests --max-line-length=200 --statistics - name: Test with pytest run: | pytest ${{ matrix.python-code-path }} --cov=${{ matrix.python-code-path }} --doctest-modules --cov-report=term --cov-fail-under=90 --cov-config=${{ matrix.python-code-path }}/pytest.ini diff --git a/salt/sensoroni/files/analyzers/build.sh b/salt/sensoroni/files/analyzers/build.sh new file mode 100755 index 000000000..5b78af785 --- /dev/null +++ b/salt/sensoroni/files/analyzers/build.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +HOME_DIR=$(dirname "$0") +TARGET_DIR=${1:-.} + +if ! which pytest &> /dev/null || ! which flake8 &> /dev/null ; then + echo "Missing dependencies. Consider running the following command:" + echo " python -m pip install flake8 pytest pytest-cov" + exit 1 +fi + +flake8 "$TARGET_DIR" --show-source --max-complexity=10 --max-line-length=200 --statistics --doctests +pytest "$TARGET_DIR" "--cov=$TARGET_DIR" --doctest-modules --cov-report=term --cov-fail-under=90 --cov-config=${HOME_DIR}/pytest.ini