Skip to content

Commit

Permalink
tox: add complexity-report target (#1119) (#1128)
Browse files Browse the repository at this point in the history
[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 <None>
  • Loading branch information
patchback[bot] authored Oct 6, 2022
1 parent c7f032a commit d3f02ee
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d3f02ee

Please sign in to comment.