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