Make shellcheck happier

This commit is contained in:
Michael Wolf
2023-09-20 10:10:50 -06:00
parent 5f9d2f7679
commit 0c667db03c

View File

@@ -15,11 +15,11 @@ file="$1"
file_type=$(sniff_file_type $file) file_type=$(sniff_file_type "$file")
wrflog got file_type $file_type wrflog got file_type "$file_type"
WOULD_REFORMAT=would_reformat export WOULD_REFORMAT=would_reformat
if [[ $file_type = "javascript" || \ if [[ $file_type = "javascript" || \
$file_type = "vue" || \ $file_type = "vue" || \
@@ -32,16 +32,16 @@ if [[ $file_type = "javascript" || \
$file_type == "css" || \ $file_type == "css" || \
$file_type == "scss" || \ $file_type == "scss" || \
$file_type = "sh" ]]; then $file_type = "sh" ]]; then
wrflog will run thing wrflog will run thing
wrflog "$(wfroot $DIR)" wrflog "$(wfroot "$DIR")"
wrflog "prettier: $(ls -l $(wfroot $DIR)/./prettier.sh)" wrflog "prettier: $(ls -l "$(wfroot "$DIR")"/./prettier.sh)"
out=$($(wfroot $DIR)/./prettier.sh $file 2>&1 > /dev/null) out=$("$(wfroot "$DIR")"/./prettier.sh "$file" 2>&1 > /dev/null)
retval="$?" retval="$?"
success_retval=0 success_retval=0
would_reformat_retval=1 would_reformat_retval=1
syntax_error_retval=2 syntax_error_retval=2
elif [[ $file_type == "python" ]]; then elif [[ $file_type == "python" ]]; then
out=$($(wfroot $DIR)/./isort-and-black.sh $file 2>&1 > /dev/null) out=$("$(wfroot "$DIR")"/./isort-and-black.sh "$file" 2>&1 > /dev/null)
retval="$?" retval="$?"
success_retval=0 success_retval=0
would_reformat_retval=1 would_reformat_retval=1
@@ -51,12 +51,12 @@ elif [[ $file_type == "golang" ]] ; then
would_reformat_retval=1 would_reformat_retval=1
syntax_error_retval=2 syntax_error_retval=2
out=$(gofmt -l $file) out=$(gofmt -l "$file")
exitval="$?" exitval="$?"
if [[ x"$exitval" = x"$syntax_error_retval" ]] ; then if [[ "$exitval" = "$syntax_error_retval" ]] ; then
retval="$exitval" retval="$exitval"
elif [[ x"$out" = x"$file" ]] ; then elif [[ "$out" = "$file" ]] ; then
retval="$would_reformat_retval" retval="$would_reformat_retval"
else else
# success # success