Make shellcheck happier
This commit is contained in:
@@ -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" || \
|
||||
$file_type = "vue" || \
|
||||
@@ -33,15 +33,15 @@ if [[ $file_type = "javascript" || \
|
||||
$file_type == "scss" || \
|
||||
$file_type = "sh" ]]; then
|
||||
wrflog will run thing
|
||||
wrflog "$(wfroot $DIR)"
|
||||
wrflog "prettier: $(ls -l $(wfroot $DIR)/./prettier.sh)"
|
||||
out=$($(wfroot $DIR)/./prettier.sh $file 2>&1 > /dev/null)
|
||||
wrflog "$(wfroot "$DIR")"
|
||||
wrflog "prettier: $(ls -l "$(wfroot "$DIR")"/./prettier.sh)"
|
||||
out=$("$(wfroot "$DIR")"/./prettier.sh "$file" 2>&1 > /dev/null)
|
||||
retval="$?"
|
||||
success_retval=0
|
||||
would_reformat_retval=1
|
||||
syntax_error_retval=2
|
||||
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="$?"
|
||||
success_retval=0
|
||||
would_reformat_retval=1
|
||||
@@ -51,12 +51,12 @@ elif [[ $file_type == "golang" ]] ; then
|
||||
would_reformat_retval=1
|
||||
syntax_error_retval=2
|
||||
|
||||
out=$(gofmt -l $file)
|
||||
out=$(gofmt -l "$file")
|
||||
exitval="$?"
|
||||
|
||||
if [[ x"$exitval" = x"$syntax_error_retval" ]] ; then
|
||||
if [[ "$exitval" = "$syntax_error_retval" ]] ; then
|
||||
retval="$exitval"
|
||||
elif [[ x"$out" = x"$file" ]] ; then
|
||||
elif [[ "$out" = "$file" ]] ; then
|
||||
retval="$would_reformat_retval"
|
||||
else
|
||||
# success
|
||||
|
||||
Reference in New Issue
Block a user