X-Git-Url: https://gerrit.onap.org/r/gitweb?p=ci-management.git;a=blobdiff_plain;f=tox.ini;h=a88044059ba25c20048d67313fb149e7d79d6ce4;hp=dbeedd8bdb1b50537a3310f57cf451ae67437b1a;hb=refs%2Fheads%2Fmaster;hpb=b2f7abc5e5a00db1658dd04d8ed96059dff70eb0 diff --git a/tox.ini b/tox.ini index dbeedd8bd..fc81f926a 100644 --- a/tox.ini +++ b/tox.ini @@ -1,21 +1,38 @@ [tox] minversion = 1.6 -envlist = coala,docs,pep8 +envlist = jjb-version skipsdist = true -[testenv:coala] -basepython = python3 +[testenv:jenkins-jobs] deps = - coala - coala-bears + jenkins-job-builder=={env:JJB_VERSION:6.0.0} commands = - python3 -m nltk.downloader punkt maxent_treebank_pos_tagger averaged_perceptron_tagger - coala --non-interactive + jenkins-jobs {posargs:--help} -# [testenv:docs] -# deps = sphinx -# commands = sphinx-build -b html -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html +[testenv:jjb-version] +commands = python {toxinidir}/check_jjb_version.py -[testenv:pep8] -deps = flake8 -commands = flake8 scripts/ +[testenv:pre-commit-install] +basepython = python3 +deps = pre-commit +commands = + pre-commit install + pre-commit install --hook-type commit-msg + +[testenv:pre-commit-uninstall] +basepython = python3 +deps = pre-commit +commands = + pre-commit uninstall + pre-commit uninstall --hook-type commit-msg + +[testenv:pre-commit] +basepython = python3 +deps = pre-commit +passenv = HOME +commands = + pre-commit run --all-files --show-diff-on-failure + pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_EDITMSG + # Gitlint only proposes a pre-commit configuration for the commit-msg stage but none for the commit stage. + # Its default arguments --passed and --msg-filename are different from CI recommandations. + # As a result, the line above is always skipped in jenkins CI since there cannot be a .git/COMMIT_EDITMSG file.