Set up shfmt

This commit is contained in:
Sven van Heugten 2026-03-02 20:53:52 +01:00
parent 769d7da9b2
commit 5dbb6aea8f
No known key found for this signature in database
GPG key ID: D612F88666F4F660
4 changed files with 16 additions and 6 deletions

View file

@ -25,7 +25,10 @@
set -euo pipefail
assert_fails() {
! "$@" || { echo "Expected command to fail, but it succeeded."; exit 1; }
! "$@" || {
echo "Expected command to fail, but it succeeded."
exit 1
}
}
export -f assert_fails
@ -42,9 +45,9 @@ for commit_hash in "${commits[@]}"; do
git -c advice.detachedHead=false checkout -q "$commit_hash"
commit_msg="$(git log -1 --format=%B "$commit_hash")"
# shellcheck disable=SC2016
block="$(printf '%s\n' "$commit_msg" \
| sed -n '/^```git-check-assertions[[:space:]]*$/,/^```[[:space:]]*$/p' \
| sed '1d;$d')"
block="$(printf '%s\n' "$commit_msg" |
sed -n '/^```git-check-assertions[[:space:]]*$/,/^```[[:space:]]*$/p' |
sed '1d;$d')"
if [ -n "$block" ]; then
echo "git-check-assertions block in $commit_hash:"
printf '%s\n' "$block" | sed 's/^/> /'