Same-line shellcheck comment explanations

These are obvious even with `git grep shellcheck`.
This commit is contained in:
Rangi
2026-07-06 04:43:08 +02:00
committed by Eldred Habert
parent 09da4e001a
commit 0adbb92e50
4 changed files with 7 additions and 18 deletions
+3 -8
View File
@@ -11,8 +11,7 @@ input="$(mktemp)"
output="$(mktemp)"
errput="$(mktemp)"
# Immediate expansion is the desired behavior.
# shellcheck disable=SC2064
# shellcheck disable=SC2064 # (Immediate expansion is the desired behavior.)
trap "rm -f ${o@Q} ${gb@Q} ${input@Q} ${output@Q} ${errput@Q}" EXIT
tests=0
@@ -91,11 +90,7 @@ for i in *.asm notexist.asm; do
continue
fi
# Stop! This is not a Useless Use Of Cat. Using cat instead of
# stdin redirection makes the input an unseekable pipe - a scenario
# that's harder to deal with and was broken when the feature was
# first implemented.
# shellcheck disable=SC2002
# shellcheck disable=SC2002 # (This use of `cat` intentionally makes the input an unseekable pipe.)
cat "$i" | "$RGBASM" "${RGBASMFLAGS[@]}" -o "$o" - >"$output" 2>"$errput"
# Use two otherwise unused files for temp storage
@@ -230,7 +225,7 @@ for variant in '' '.pipe'; do
if [ -z "$variant" ]; then
"$RGBASM" "${RGBASMFLAGS[@]}" -s "$state_features:$state_outname" "$i"/a.asm >"$output" 2>"$errput"
else
# shellcheck disable=SC2002
# shellcheck disable=SC2002 # (This use of `cat` intentionally makes the input an unseekable pipe.)
cat "$i"/a.asm | "$RGBASM" "${RGBASMFLAGS[@]}" -s "$state_features:$state_outname" - >"$output" 2>"$errput"
fi
+2 -6
View File
@@ -3,8 +3,7 @@
export LC_ALL=C
tmpdir="$(mktemp -d)"
# Immediate expansion is the desired behavior.
# shellcheck disable=SC2064
# shellcheck disable=SC2064 # (Immediate expansion is the desired behavior.)
trap "cd; rm -rf ${tmpdir@Q}" EXIT
src="$PWD"
@@ -73,10 +72,7 @@ runTest () {
eval "$RGBFIX" $flags out.gb '>out.out' '2>out.err'
subst=out.gb
elif [[ "$variant" = ' piped' ]]; then
# Stop! This is not a Useless Use Of Cat. Using cat instead of
# stdin redirection makes the input an unseekable pipe - a scenario
# that's harder to deal with.
# shellcheck disable=SC2002
# shellcheck disable=SC2002 # (This use of `cat` intentionally makes the input an unseekable pipe.)
cat "$desired_input" | eval "$RGBFIX" $flags - '>out.gb' '2>out.err'
subst='<stdin>'
elif [[ "$variant" = ' output' ]]; then
+1 -2
View File
@@ -5,8 +5,7 @@
errtmp="$(mktemp)"
# Immediate expansion is the desired behavior.
# shellcheck disable=SC2064
# shellcheck disable=SC2064 # (Immediate expansion is the desired behavior.)
trap "rm -f ${errtmp@Q} result.{png,1bpp,2bpp,pal,tilemap,attrmap,palmap} out*.png" EXIT
tests=0
+1 -2
View File
@@ -10,8 +10,7 @@ outtemp="$(mktemp)"
outtemp2="$(mktemp)"
outtemp3="$(mktemp)"
# Immediate expansion is the desired behavior.
# shellcheck disable=SC2064
# shellcheck disable=SC2064 # (Immediate expansion is the desired behavior.)
trap "rm -f ${otemp@Q} ${gbtemp@Q} ${gbtemp2@Q} ${outtemp@Q} ${outtemp2@Q} ${outtemp3@Q}" EXIT
tests=0