Add utils/lint.sh

Signed-off-by: Drew DeVault <sir@cmpwn.com>
This commit is contained in:
Drew DeVault 2024-03-25 17:47:34 +01:00
parent 053be3dbf6
commit 0a2132f33d
2 changed files with 26 additions and 0 deletions

View File

@ -12,6 +12,9 @@ packages:
sources: sources:
- https://codeberg.org/redict/redict.git - https://codeberg.org/redict/redict.git
tasks: tasks:
- lint: |
cd redict
./utils/lint.sh
- make: | - make: |
cd redict cd redict
make -C src V=1 USE_JEMALLOC=no MALLOC=libc BUILD_TLS=yes make -C src V=1 USE_JEMALLOC=no MALLOC=libc BUILD_TLS=yes

23
utils/lint.sh Executable file
View File

@ -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