[COMMON] Add git commit linting 04/116204/1
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>
Mon, 7 Dec 2020 08:15:19 +0000 (09:15 +0100)
committerSylvain Desbureaux <sylvain.desbureaux@orange.com>
Wed, 9 Dec 2020 08:04:39 +0000 (08:04 +0000)
Add an automated git commit linting in order to be sure commit messages
are set the way we want.

Issue-ID: OOM-2644
Signed-off-by: Sylvain Desbureaux <sylvain.desbureaux@orange.com>
Change-Id: I36a397c318886f2ac05a8971147272669c7a4cd9
(cherry picked from commit 3c393e59b60734b4a1c163eb3e175507a32519ad)

.gitlint [new file with mode: 0644]
tox.ini [new file with mode: 0644]

diff --git a/.gitlint b/.gitlint
new file mode 100644 (file)
index 0000000..9f3a51d
--- /dev/null
+++ b/.gitlint
@@ -0,0 +1,13 @@
+[title-match-regex]
+regex=^\[[A-Z0-9]+]\[*[A-Z0-9]*]* [A-Z]+[\S ]*$
+
+[body-match-regex]
+regex=.{20,}
+
+[ignore-by-title]
+regex=^Release(.*)
+ignore=title-match-regex,body-min-length
+
+[ignore-body-lines]
+regex=^(Issue-ID|Signed-off-by|Change-Id|Reported-by|Depends-on|Co-authored-by|Fixes|Acked-by|Reviewed-by|CC)
+
diff --git a/tox.ini b/tox.ini
new file mode 100644 (file)
index 0000000..60f93a3
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,14 @@
+[tox]
+minversion = 1.6
+envlist =
+ gitlint,
+skipsdist=true
+
+[testenv:gitlint]
+basepython = python3
+deps =
+  gitlint
+
+commands =
+  gitlint
+