CI: kick git hook pre-commit install out from CI 39/67839/1
authorGuillaume Lambert <guillaume.lambert@orange.com>
Fri, 28 May 2021 12:56:51 +0000 (14:56 +0200)
committerGuillaume Lambert <guillaume.lambert@orange.com>
Fri, 28 May 2021 13:51:54 +0000 (15:51 +0200)
pre-commit hook installation is not required to run pre-commit run jobs.
And thus it is not wishable in CI and morevover in a local context since
no uninstallation method is provided in tox.

Signed-off-by: Guillaume Lambert <guillaume.lambert@orange.com>
Change-Id: Idd7f1757b9814edfdeeb4013d086c8c63a6d812d

tox.ini

diff --git a/tox.ini b/tox.ini
index 88c59d6..a1f2e6b 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -26,11 +26,22 @@ deps = -rdocs/requirements.txt
 commands =
     sphinx-build -q -j auto --keep-going -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck
 
-[testenv:pre-commit]
+[testenv:pre-commit-install]
 basepython = python3
 deps = pre-commit
 commands =
     pre-commit install --hook-type commit-msg
+
+[testenv:pre-commit-uninstall]
+basepython = python3
+deps = pre-commit
+commands =
+    pre-commit uninstall --hook-type commit-msg
+
+[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
 
@@ -38,3 +49,4 @@ commands =
 basepython = python3
 deps = -rdocs/requirements.txt
 commands = reno {posargs:--help}
+