Skip to content

Commit

Permalink
Add tox labels for lint, format and unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tremble committed Sep 28, 2023
1 parent ce98cd6 commit b281b99
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
[tox]
skipsdist=True
skipsdist = True
envlist = clean,ansible{2.12,2.13}-py{38,39,310}-{with_constraints,without_constraints},linters
# Tox4 supports labels which allow us to group the environments rather than dumping all commands into a single environment
labels =
format = black, isort
lint = complexity-report, black-lint, isort-lint, flake8-lint
units = ansible{2.12,2.13}-py{38,39,310}-{with_constraints,without_constraints}

[testenv]
description = Run the test-suite and generate a HTML coverage report
Expand Down Expand Up @@ -34,6 +39,30 @@ deps =
commands =
black {toxinidir}/plugins {toxinidir}/tests

[testenv:black-lint]
deps =
{[testenv:black]deps}
commands =
black -v --check --diff {toxinidir}/plugins {toxinidir}/tests

[testenv:isort]
deps =
isort
commands =
isort {toxinidir}/plugins {toxinidir}/tests

[testenv:isort-lint]
deps =
{[testenv:isort]deps}
commands =
isort --check-only --diff {toxinidir}/plugins {toxinidir}/tests

[testenv:flake8-lint]
deps =
flake8
commands =
flake8 {posargs} {toxinidir}/plugins {toxinidir}/tests

[testenv:linters]
deps =
{[testenv:black]deps}
Expand Down

0 comments on commit b281b99

Please sign in to comment.