[tox] envlist = py{py3}-{test,pylint,flake8} py{38,39,310,311,312}-{test,mypy,pylint,flake8} cov skip_missing_interpreters = true [testenv] deps = test: pytest test,cov: {[testenv:cov]deps} test,py{38,39,310,311,312}-{type,mypy}: colorama py{38,39,310,311,312}-{type,mypy}: {[testenv:mypy]deps} py{py3,38,39,310,311,312}-{lint,pylint},lint: {[testenv:pylint]deps} py{py3,38,39,310,311,312}-{lint,flake8},lint: {[testenv:flake8]deps} setenv = SSHAUDIT = {toxinidir}/src test: COVERAGE_FILE = {toxinidir}/.coverage.{envname} type,mypy: MYPYPATH = {toxinidir}/test/stubs type,mypy: MYPYHTML = {toxinidir}/reports/html/mypy commands = test: coverage run --source ssh_audit -m -p -- \ test: pytest -v --junitxml={toxinidir}/reports/junit.{envname}.xml {posargs:test} test: coverage combine test: coverage report --show-missing test: coverage html -d {toxinidir}/reports/html/coverage.{envname} py{38,39,310,311,312}-{type,mypy}: {[testenv:mypy]commands} py{py3,38,39,310,311,312}-{lint,pylint},lint: {[testenv:pylint]commands} py{py3,38,39,310,311,312}-{lint,flake8},lint: {[testenv:flake8]commands} #ignore_outcome = # type: true # lint: true [testenv:cov] deps = coverage setenv = COVERAGE_FILE = {toxinidir}/.coverage commands = coverage erase coverage combine coverage report --show-missing coverage xml -i -o {toxinidir}/reports/coverage.xml coverage html -d {toxinidir}/reports/html/coverage [testenv:mypy] deps = colorama lxml mypy commands = mypy \ --strict \ --show-error-context \ --html-report {env:MYPYHTML}.py3.{envname} \ {posargs:{env:SSHAUDIT}} [testenv:pylint] deps = mccabe pylint commands = pylint \ --rcfile tox.ini \ --load-plugins=pylint.extensions.bad_builtin \ --load-plugins=pylint.extensions.check_elif \ --load-plugins=pylint.extensions.mccabe \ {posargs:{env:SSHAUDIT}} [testenv:flake8] deps = flake8 commands = flake8 {posargs:{env:SSHAUDIT} {toxinidir}/setup.py {toxinidir}/test {toxinidir}/ssh-audit.py} --statistics [pylint] reports = no #output-format = colorized indent-string = " " disable = broad-except, duplicate-code, fixme, invalid-name, line-too-long, missing-docstring, no-else-raise, no-else-return, super-with-arguments, # Can be re-factored, at some point. too-complex, too-many-arguments, too-many-boolean-expressions, too-many-branches, too-many-instance-attributes, too-many-lines, too-many-locals, too-many-nested-blocks, too-many-positional-arguments, too-many-return-statements, too-many-statements, consider-using-f-string max-complexity = 15 max-args = 8 max-locals = 20 max-returns = 6 max-branches = 15 max-statements = 60 max-parents = 7 max-attributes = 8 min-public-methods = 1 max-public-methods = 20 max-bool-expr = 5 max-nested-blocks = 6 max-line-length = 80 ignore-long-lines = ^\s*(#\s+type:\s+.*|[A-Z0-9_]+\s+=\s+.*|('.*':\s+)?\[.*\],?|assert\s+.*)$ max-module-lines = 2500 [flake8] # E241 = multiple spaces after operator; should be kept for tabular data # E303 = too many blank lines # E501 = line too long ignore = E241, E303, E501 [pytest] junit_family = xunit1 [coverage:paths] source = src */site-packages