[tox]
envlist=mypy,py35,py36,integration_tests,lint

[testenv]
deps=
    -rtest-requirements.txt
commands=
    pytest --cov=jenkins_job_linter

[testenv:integration_tests]
commands=
    pytest --cov=jenkins_job_linter integration_tests/tests.py

[testenv:lint]
deps=
    flake8
    isort
    pydocstyle
    -rtest-requirements.txt
commands=
    flake8 jenkins_job_linter tests integration_tests
    isort --diff --recursive --check jenkins_job_linter tests integration_tests
    pydocstyle jenkins_job_linter

[testenv:mypy]
deps=
    git+https://github.com/python/mypy.git#egg=mypy
commands=
    mypy --ignore-missing-imports --strict jenkins_job_linter

[testenv:codecov]
# Upload coverage report to codecov.io; only intended for Travis use
passenv = CI TRAVIS TRAVIS_*
deps=
    -rtest-requirements.txt
    codecov
commands=
    pytest --cov=jenkins_job_linter
    codecov --flags unit
    coverage erase
    pytest --cov=jenkins_job_linter integration_tests/tests.py
    codecov --flags integration

[tox]
envlist=mypy,py35,py36,integration_tests,lint

[testenv]
deps=
    -rtest-requirements.txt
commands=
    pytest --cov=jenkins_job_linter

[testenv:integration_tests]
commands=
    pytest --cov=jenkins_job_linter integration_tests/tests.py

[testenv:lint]
deps=
    flake8
    isort
    pydocstyle
    -rtest-requirements.txt
commands=
    flake8 jenkins_job_linter tests integration_tests
    isort --diff --recursive --check jenkins_job_linter tests integration_tests
    pydocstyle jenkins_job_linter

[testenv:mypy]
deps=
    git+https://github.com/python/mypy.git#egg=mypy
commands=
    mypy --ignore-missing-imports --strict jenkins_job_linter

[testenv:codecov]
# Upload coverage report to codecov.io; only intended for Travis use
passenv = CI TRAVIS TRAVIS_*
deps=
    -rtest-requirements.txt
    codecov
commands=
    pytest --cov=jenkins_job_linter
    codecov --flags unit
    coverage erase
    rm coverage.xml
    pytest --cov=jenkins_job_linter integration_tests/tests.py
    codecov --flags integration

Remove coverage.xml before second codecov run
Remove coverage.xml before second codecov run
