Update pre-commit configuration for gitlint to add gitlint-ci, a hook
for CI verification, and use it during tox verification.
Create separate testenvs for installation/uninstallation/update of
pre-commit hook scripts. And also add a testenv for gitlint to run
the command with tox.
Change-Id: I3842539a7ec8d2851ff1b48c2633d964017c70cf
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
additional_dependencies: ['robotframework']
- repo: https://github.com/jorisroovers/gitlint
- rev: v0.17.0
+ rev: v0.19.1
hooks:
- - id: gitlint
+ - id: gitlint
+ stages: [commit-msg]
+ - id: gitlint-ci
+ stages: [manual]
- repo: local
hooks:
commands =
sphinx-build -W -n -b html -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html
-[testenv:pre-commit]
+[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-autoupdate]
+basepython = python3
+deps = pre-commit
+commands =
+ pre-commit autoupdate
+
+[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
+ pre-commit run gitlint-ci --hook-stage manual
+
+[testenv:gitlint]
+basepython = python3
+deps = gitlint
+commands =
+ gitlint