[util] Catch more problems with commit lint
This improves the commit lint script to catch a couple more problems:
* The commit message is now checked:
* We require an empty second line, separating the summary (first line)
from the optional long description (lines 3-). (In fact, git
shortlog assumes that everything before the first empty line is the
summary, leading to a summary line containing the whole commit
message if there's no empty line in between.)
* The summary line should not be overly long. The often-recommended
limit is 50 characters, but there is no hard rule. This commit enforces
a 100 character limit on the first line, which should be lenient
enough.
* There's now a warning if the author name does not contain a space.
That typically indicates that the user didn't set his real name but a
GitHub username as name. It's not an error because there's no
universal rule that names must consist of multiple words.
In addition to these functional changes, the implementation switched to
use GitPython, avoiding manually calling git and parsing its output.
Note: Merge commits are not checked in our CI setup. When Azure
Pipelines runs, it tests the PR merge into origin/master. The merge
commit is added by GitHub with author information as set in the GitHub
UI: the full name (if set) or the GitHub username, and the public email
address. This commit will not appear in our repository when doing
"rebase merges". Checking merge commits would check something other than
the commits as we ultimately see them in our repo, raising false alarm.
diff --git a/python-requirements.txt b/python-requirements.txt
index bdde800..7ccf2a2 100644
--- a/python-requirements.txt
+++ b/python-requirements.txt
@@ -9,6 +9,7 @@
pyyaml
pytest
fusesoc
+gitpython
# Develpment version to get around YAML parser warning triggered by fusesoc
# Upstream tracking: https://github.com/olofk/ipyxact/issues/19