Update toxfile

Wrap long lines to improve readability
Update safety command to use --json flag instead of --bare flag
Update security env to skip package install
This commit is contained in:
Ethan Paul 2022-01-05 01:13:44 -05:00
parent bb0db0fa1d
commit 087db95c43
No known key found for this signature in database
GPG Key ID: D0E2CBF1245E92BF

42
tox.ini
View File

@ -14,7 +14,10 @@ locked_deps =
pytest-cov pytest-cov
toml toml
commands = commands =
pytest --cov {toxinidir}/tox_poetry_installer --cov-config {toxinidir}/.coveragerc --cov-report term-missing {toxinidir}/tests/ pytest {toxinidir}/tests/ \
--cov {toxinidir}/tox_poetry_installer \
--cov-config {toxinidir}/.coveragerc \
--cov-report term-missing
[testenv:static] [testenv:static]
description = Static formatting and quality enforcement description = Static formatting and quality enforcement
@ -32,9 +35,13 @@ locked_deps =
pre-commit-hooks pre-commit-hooks
pylint pylint
commands = commands =
pre-commit run --all-files pre-commit run \
pylint --rcfile {toxinidir}/.pylintrc {toxinidir}/tox_poetry_installer/ --all-files
mypy --ignore-missing-imports --no-strict-optional {toxinidir}/tox_poetry_installer/ pylint {toxinidir}/tox_poetry_installer/ \
--rcfile {toxinidir}/.pylintrc
mypy {toxinidir}/tox_poetry_installer/ \
--ignore-missing-imports \
--no-strict-optional
[testenv:static-tests] [testenv:static-tests]
description = Static formatting and quality enforcement for the tests description = Static formatting and quality enforcement for the tests
@ -46,20 +53,35 @@ locked_deps =
pytest pytest
mypy mypy
commands = commands =
pylint --rcfile {toxinidir}/.pylintrc {toxinidir}/tests/ pylint {toxinidir}/tests/ \
mypy --ignore-missing-imports --no-strict-optional {toxinidir}/tests/ --rcfile {toxinidir}/.pylintrc
mypy {toxinidir}/tests/ \
--ignore-missing-imports \
--no-strict-optional
[testenv:security] [testenv:security]
description = Security checks description = Security checks
basepython = python3.8 basepython = python3.8
platform = linux platform = linux
ignore_errors = true ignore_errors = true
skip_install = true
locked_deps = locked_deps =
bandit bandit
safety safety
poetry poetry
commands = commands =
bandit --recursive --quiet {toxinidir}/tox_poetry_installer/ bandit {toxinidir}/tox_poetry_installer/ \
bandit --recursive --quiet --skip B101 {toxinidir}/tests/ --recursive \
poetry export --format requirements.txt --output {envtmpdir}/requirements.txt --without-hashes --dev --quiet
safety check --bare --file {envtmpdir}/requirements.txt bandit {toxinidir}/tests/ \
--recursive \
--quiet \
--skip B101
poetry export \
--format requirements.txt \
--output {envtmpdir}/requirements.txt \
--without-hashes \
--dev
safety check \
--file {envtmpdir}/requirements.txt \
--json