Retire mdsal-7.0.x jobs
[releng/builder.git] / tox.ini
diff --git a/tox.ini b/tox.ini
index 4ab7773a42e8c4bf815c0bfa7779c99bbc052283..f1635af34d43fe9bbce7b4eb64dac13cecbc602d 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -22,13 +22,30 @@ commands =
 [testenv:jjb-version]
 commands = python {toxinidir}/check_jjb_version.py
 
-[testenv:pre-commit]
+[testenv:pre-commit-install]
 basepython = python3
-deps = pre-commit==2.9.3
+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.
 
 [testenv:prefix]
 commands = python {toxinidir}/check_prefix.py