[tox]
envlist = test
skip_missing_interpreters = True
isolated_build = True
setenv =
    PYTHONDONTWRITEBYTECODE=1

[testenv:isort]
commands =
    isort src/djlint
    isort tests
skip_install: True
allowlist_externals = isort

[testenv:black]
commands =
    black src/djlint
    black tests
skip_install: True
allowlist_externals = black

[testenv:lint]
deps =
    ; flake8 has a dep conflict
    ; some can be installed manually
    ; here.
    flake8
    flake8-print
    flake8-docstrings
    flake8-builtins
    flake8-comprehensions
    flake8-pytest-style
    flake8-simplify
    flake8-variables-names
commands =
    flake8 src/djlint
    black --fast --check src/djlint
    pylint src/djlint
    mypy src/djlint
    flake8 tests
    black --fast --check tests
    pylint tests
    mypy tests
skip_install: true
allowlist_externals =
    black
    mypy
    pylint

[testenv]
commands =
    pytest --cov=src/djlint --cov-branch --cov-report xml:coverage.xml --cov-report term-missing {posargs:} -n auto --dist loadgroup
skip_install: false
allowlist_externals = pytest

[testenv:test-fast]
commands =
    pytest -n 4
skip_install: false
allowlist_externals = pytest
