Add GitLint which replaces GitCommitBear 78/62978/1
authorThanh Ha <zxiiro@gmail.com>
Tue, 28 Jan 2020 15:58:50 +0000 (10:58 -0500)
committerThanh Ha <zxiiro@gmail.com>
Tue, 28 Jan 2020 15:58:50 +0000 (10:58 -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: I3480ad81702fa6b5015523a7274e219ba2f240d0

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

index 9412814..5b4657b 100644 (file)
--- a/.coafile
+++ b/.coafile
@@ -7,14 +7,6 @@ ignore = .tox/**,
     .pytest_cache/**,
     node_modules/**
 
-[all.Git]
-bears = GitCommitBear
-ignore_length_regex = Signed-off-by,
-    Also-by,
-    Co-authored-by,
-    http://,
-    https://
-
 [all.Documentation]
 bears = WriteGoodLintBear
 files = docs/**/*.rst
index ce05348..43bd6f9 100644 (file)
@@ -4,3 +4,8 @@ repos:
     rev: v1.3.0
     hooks:
       - id: trailing-whitespace
+
+  - repo: https://github.com/jorisroovers/gitlint
+    rev: v0.12.0
+    hooks:
+      - id: gitlint
diff --git a/tox.ini b/tox.ini
index d86a5ca..87b25ba 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -60,8 +60,8 @@ commands =
 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