Make shfmt happier

This commit is contained in:
Michael Wolf
2023-09-30 17:30:15 -06:00
parent 9936c641a2
commit 5d3dc8003e

View File

@@ -9,17 +9,17 @@ source "$DIR/_reformat-common.bash"
file="$1"
if [[ "$WOULD_REFORMAT" = "would_reformat" ]] ; then
if [[ "$WOULD_REFORMAT" = "would_reformat" ]]; then
out1=$(pipx run isort "$file" 2>/dev/null)
c1="$?"
if [[ "$c1" != "0" ]] ; then
if [[ "$c1" != "0" ]]; then
# would reorder imports
if [[ "$c1" = "1" ]] ; then
if [[ "$c1" = "1" ]]; then
exit 1
fi
# syntax error; 123 is normalized to 2
if [[ "$c1" = "123" ]] ; then
if [[ "$c1" = "123" ]]; then
exit 2
fi
# some other problem that we don't know how to handle
@@ -34,7 +34,7 @@ if [[ "$WOULD_REFORMAT" = "would_reformat" ]] ; then
exit "$c2"
fi
if [[ "$WOULD_REFORMAT" = "do_reformat" ]] ; then
if [[ "$WOULD_REFORMAT" = "do_reformat" ]]; then
out1=$(pipx run black "$1" 2>/dev/null && pipx run isort "$file" 2>/dev/null)
c="$?"
@@ -44,4 +44,3 @@ if [[ "$WOULD_REFORMAT" = "do_reformat" ]] ; then
fi
exit 255