summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBence Ferdinandy <bence@ferdinandy.com>2024-01-17 14:02:18 +0100
committerRobin Jarry <robin@jarry.cc>2024-01-18 22:07:21 +0100
commitcefdce3f82b8a477a74f573b86df8c7f2c1017a8 (patch)
treed0ee7bee9a3e1f08615305d9a6a88fb84e48bf9c
parent51ec0159ec8c51e6bcba9a420de776f4738f02eb (diff)
downloadaerc-cefdce3f82b8a477a74f573b86df8c7f2c1017a8.tar.gz
aerc-cefdce3f82b8a477a74f573b86df8c7f2c1017a8.zip
check-patches: enforce prose on changelog entries
Check if the Changelog-*: trailers have proper English sentences starting with a capital letter and ending in a period. Update CONTRIBUTING with an explicit mention of this. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Reviewed-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
-rw-r--r--CONTRIBUTING.md4
-rwxr-xr-xcontrib/check-patches6
2 files changed, 9 insertions, 1 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 1a4d0bd2..6c9df2c7 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -44,7 +44,9 @@ commits). Follow these general rules:
trailer with the commit id and its title.
- When in doubt, follow the format and layout of the recent existing commits.
- If your commit brings visible changes for end-users, add one of the following
- trailers with a short and concise description of the change.
+ trailers with a short and concise description of the change. The change
+ should be described in full sentences, starting with a capital letter and
+ ending in a period.
* `Changelog-added:` for new features.
* `Changelog-fixed:` for bug fixes.
diff --git a/contrib/check-patches b/contrib/check-patches
index 450eabae..cea65a1f 100755
--- a/contrib/check-patches
+++ b/contrib/check-patches
@@ -39,6 +39,12 @@ for rev in $revisions; do
err "'Signed-off-by: $author' trailer is missing"
fi
+ if git log --format="%(trailers:only,unfold)" -1 "$rev" | \
+ grep -v '^Changelog-[a-z]\+: [A-Z`\*_].\+\.$' | \
+ grep -q '^Changelog-[a-z]\+: '; then
+ err "Changelog-* trailers should start with a capital letter and end with a period"
+ fi
+
body=$(git log --format='%b' -1 "$rev")
body=${body%$(git log --format='%(trailers)' -1 "$rev")}
if [ "$(echo "$body" | wc -w)" -lt 3 ]; then