Fix shellcheck issues

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2024-03-21 17:48:46 +01:00
parent 45334b6736
commit b6fd4912d7
6 changed files with 22 additions and 19 deletions

View File

@@ -2,11 +2,11 @@
# Based on Github Action
# https://github.com/yshui/git-clang-format-lint
diff=`git-clang-format --diff --commit $CI_MERGE_REQUEST_DIFF_BASE_SHA`
diff=$(git-clang-format --diff --commit "$CI_MERGE_REQUEST_DIFF_BASE_SHA")
[ "$diff" = "no modified files to format" ] && exit 0
[ "$diff" = "clang-format did not modify any files" ] && exit 0
printf "You have introduced coding style breakages, suggested changes:\n\n"
echo "$diff" | colordiff
echo "${diff}" | colordiff
exit 1

View File

@@ -21,12 +21,12 @@ echo -e "${blue}Checking commit range: $CI_COMMIT_RANGE"
echo
echo
for commit in `git rev-list $CI_COMMIT_RANGE`; do
git show -s --format=%B $commit | grep "^Signed-off-by: " 2>&1 >/dev/null
for commit in $(git rev-list "$CI_COMMIT_RANGE"); do
git show -s --format=%B "$commit" | grep "^Signed-off-by: " >/dev/null 2>&1
ret=$?
if [ $ret -eq 1 ]; then
echo -e "${red} >>> Missing Signed-off-by trailer in commit $commit"
failed=`expr $failed + 1`
failed=$(("$failed" + 1))
fi
done