From d3f02ee4263f8126e0417131dd017f6a7fe23515 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Thu, 6 Oct 2022 14:48:51 +0000 Subject: [PATCH] tox: add complexity-report target (#1119) (#1128) [PR #1119/6d0d5adf backport][stable-4] tox: add complexity-report target This is a backport of PR #1119 as merged into main (6d0d5ad). Depends-On: ansible/ansible-zuul-jobs#1656 The target generates a MCCabe complexity report in HTML that is exposed in the CI output. Example: https://7409a00e1108ff27cfe6-3e5213eac2b0662b5ee6d363d9d4dcd9.ssl.cf1.rackcdn.com/1119/b90d2618ab09f30ad3540afd5bb3890af51db32c/check/cloud-tox-py3/2f3e4dc/docs/complexity/index.html Reviewed-by: Mark Chappell --- tox.ini | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tox.ini b/tox.ini index 04a0e5bf7d1..eb08d5a203d 100644 --- a/tox.ini +++ b/tox.ini @@ -18,3 +18,10 @@ commands = pytest --cov-report html --cov plugins {posargs:tests/} deps = coverage skip_install = true commands = coverage erase + +[testenv:complexity-report] +deps = + # See: https://github.com/lordmauve/flake8-html/issues/30 + flake8>=3.3.0,<5.0.0' + flake8-html +commands = -flake8 --select C90 --max-complexity 10 --format=html --htmldir={posargs} plugins