diff --git a/.changelog/7f722301e34140f7bbf0b4126709342d.md b/.changelog/7f722301e34140f7bbf0b4126709342d.md new file mode 100644 index 0000000..0d836ad --- /dev/null +++ b/.changelog/7f722301e34140f7bbf0b4126709342d.md @@ -0,0 +1,4 @@ +--- +type: none +--- +Add JSON coverage report format \ No newline at end of file diff --git a/.gitignore b/.gitignore index e87cd1c..c46e880 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ /build/ /config/ .coverage +coverage.json coverage.xml dist/ docs/_build/ diff --git a/script/coverage b/script/coverage index 674373e..c60ebc2 100755 --- a/script/coverage +++ b/script/coverage @@ -12,19 +12,20 @@ PRAGMA_OUTPUT=$(grep -r -I --line-number "# pragma: \+no.*cover" "$SOURCE_DIR" | PRAGMA_COUNT=$(echo "$PRAGMA_OUTPUT" | grep -c . || true) PRAGMA_ALLOWED=5 if [ "$PRAGMA_COUNT" -ne "$PRAGMA_ALLOWED" ]; then - echo "Found $PRAGMA_COUNT instances of 'pragma: no cover' (no more than $PRAGMA_ALLOWED allowed):" - echo "$PRAGMA_OUTPUT" - echo "Code coverage should not be disabled, except for version handling blocks" - exit 1 + echo "Found $PRAGMA_COUNT instances of 'pragma: no cover' (no more than $PRAGMA_ALLOWED allowed):" + echo "$PRAGMA_OUTPUT" + echo "Code coverage should not be disabled, except for version handling blocks" + exit 1 fi pytest \ - --disable-network \ - --cov-reset \ - --cov=$SOURCE_DIR \ - --cov-fail-under=100 \ - --cov-report=html \ - --cov-report=xml \ - --cov-report=term \ - --cov-branch \ - "$@" + --disable-network \ + --cov-reset \ + --cov=$SOURCE_DIR \ + --cov-fail-under=100 \ + --cov-report=html \ + --cov-report=json \ + --cov-report=xml \ + --cov-report=term \ + --cov-branch \ + "$@"