Add GitLint which replaces GitCommitBear 76/62976/2
authorThanh Ha <zxiiro@gmail.com>
Tue, 28 Jan 2020 15:39:05 +0000 (10:39 -0500)
committerThanh Ha <zxiiro@gmail.com>
Tue, 28 Jan 2020 15:47:14 +0000 (10:47 -0500)
The GitCommitBear was removed via
I8d782822ca87add9108a044fd6e19b1c23686717 this replaces it with
GitLint which does similar linting for git commit messages.

Issue: RELENG-2642
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
Change-Id: I6e47db45a6c5c519ee795adf15c4243fb0bfb6dd

.pre-commit-config.yaml
tox.ini

index 047fc32..6a43c26 100644 (file)
@@ -10,6 +10,11 @@ repos:
     hooks:
       - id: prettier
 
+  - repo: https://github.com/jorisroovers/gitlint
+    rev: v0.12.0
+    hooks:
+      - id: gitlint
+
   - repo: https://github.com/jumanjihouse/pre-commit-hooks
     rev: 1.11.2
     hooks:
diff --git a/tox.ini b/tox.ini
index 5bff9ee..5f647f2 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -21,8 +21,8 @@ commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinid
 basepython = python3
 deps = pre-commit
 commands =
-    pre-commit install
     pre-commit run --all-files
+    pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_EDITMSG
 
 [testenv:reno]
 basepython = python3