[tox]
minversion = 1.6
-envlist = docs
+envlist = pre-commit,docs,docs-linkcheck
skipsdist = true
[testenv:docs]
-deps = sphinx
-commands = sphinx-build -b html -d {envtmpdir}/doctrees ./docs/ {envtmpdir}/html
+basepython = python3
+deps = -rdocs/requirements.txt
+commands =
+ sphinx-build -j auto -W -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html
+
+[testenv:docs-linkcheck]
+basepython = python3
+deps = -rdocs/requirements.txt
+commands = sphinx-build -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck
+
+[testenv:pre-commit]
+basepython = python3
+deps = pre-commit
+commands =
+ pre-commit run --all-files --show-diff-on-failure
+ pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_EDITMSG