From 0a2132f33dbbe505640480c2821b2b92d33864fb Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Mon, 25 Mar 2024 17:47:34 +0100 Subject: [PATCH] Add utils/lint.sh Signed-off-by: Drew DeVault --- .builds/alpine.yml | 3 +++ utils/lint.sh | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100755 utils/lint.sh diff --git a/.builds/alpine.yml b/.builds/alpine.yml index 938732f50..f83956d5f 100644 --- a/.builds/alpine.yml +++ b/.builds/alpine.yml @@ -12,6 +12,9 @@ packages: sources: - https://codeberg.org/redict/redict.git tasks: + - lint: | + cd redict + ./utils/lint.sh - make: | cd redict make -C src V=1 USE_JEMALLOC=no MALLOC=libc BUILD_TLS=yes diff --git a/utils/lint.sh b/utils/lint.sh new file mode 100755 index 000000000..497fc3296 --- /dev/null +++ b/utils/lint.sh @@ -0,0 +1,23 @@ +#!/bin/sh -e +signoff() { + if ! git log --format='%b' HEAD^.. | grep 'Signed-off-by' >/dev/null + then + echo "Missing sign-off" >&2 + return 1 + fi +} + +exitcode=0 +for step in signoff +do + if ! $step + then + exitcode=1 + fi +done + +if [ $exitcode -eq 0 ] +then + echo "Everything looks good!" +fi +exit $exitcode