Add GitLint which replaces GitCommitBear 77/62977/1
authorThanh Ha <zxiiro@gmail.com>
Tue, 28 Jan 2020 15:55:55 +0000 (10:55 -0500)
committerThanh Ha <zxiiro@gmail.com>
Tue, 28 Jan 2020 15:57:13 +0000 (10:57 -0500)
This replaces GitCommitBear with GitLint which does similar
linting for git commit messages but using pre-commit hooks.

Signed-off-by: Thanh Ha <zxiiro@gmail.com>
Change-Id: I1622148cc36f072c7c412e88c1945b518b816793

.coafile
.pre-commit-config.yaml
tox.ini

index 84e59c2..e36c7a7 100755 (executable)
--- a/.coafile
+++ b/.coafile
@@ -8,14 +8,6 @@ ignore = .tox/**,
     **.sw?,
     **.orig
 
-[all.GitCommit]
-bears = GitCommitBear
-ignore_length_regex = Signed-off-by,
-    Also-by,
-    Co-authored-by,
-    http://,
-    https://
-
 [all.Groovy]
 bears = SpaceConsistencyBear
 files = **.groovy
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 a272a83..06b418a 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -70,6 +70,7 @@ deps =
     pre-commit
 commands =
     pre-commit run --all-files
+    pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_EDITMSG
 
 #########
 # Tools #