aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/check-patches
diff options
context:
space:
mode:
authorBence Ferdinandy <bence@ferdinandy.com>2024-01-17 14:02:19 +0100
committerRobin Jarry <robin@jarry.cc>2024-01-18 22:07:21 +0100
commit9a255ab5b7bc8c85b990cf9a290fc3a1ff3b7ce4 (patch)
tree195a14f859915c46cef7a405f5736df5029194ec /contrib/check-patches
parentcefdce3f82b8a477a74f573b86df8c7f2c1017a8 (diff)
downloadaerc-9a255ab5b7bc8c85b990cf9a290fc3a1ff3b7ce4.tar.gz
check-patches: enforce trailer list
With the new Changelog-*: trailers it's important that trailers are not misspelled accidentally and to cut down on trailer clutter. Add an explicit list of accepted trailers with their preferred ordering and some explanation where warranted to CONTRIBUTING. Enforce the list in CI. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Reviewed-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'contrib/check-patches')
-rwxr-xr-xcontrib/check-patches27
1 files changed, 27 insertions, 0 deletions
diff --git a/contrib/check-patches b/contrib/check-patches
index cea65a1f..e175b32c 100755
--- a/contrib/check-patches
+++ b/contrib/check-patches
@@ -11,6 +11,27 @@ if [ "$total" -eq 0 ]; then
exit 0
fi
+allowed_trailers="
+Fixes
+Implements
+References
+Link
+Changelog-added
+Changelog-fixed
+Changelog-changed
+Changelog-deprecated
+Cc
+Suggested-by
+Requested-by
+Reported-by
+Co-authored-by
+Signed-off-by
+Tested-by
+Reviewed-by
+Acked-by
+"
+
+
n=0
title=
fail=false
@@ -39,6 +60,12 @@ for rev in $revisions; do
err "'Signed-off-by: $author' trailer is missing"
fi
+ for trailer in $(git log --format="%(trailers:only,keyonly)" -1 "$rev"); do
+ if ! echo "$allowed_trailers" | grep -qFx "$trailer"; then
+ err "trailer '$trailer' is misspelled or not in the sanctioned list"
+ fi
+ done
+
if git log --format="%(trailers:only,unfold)" -1 "$rev" | \
grep -v '^Changelog-[a-z]\+: [A-Z`\*_].\+\.$' | \
grep -q '^Changelog-[a-z]\+: '; then