Make shfmt happier
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/bin/bash
|
||||
|
||||
set -uo pipefail
|
||||
IFS=$'\n\t'
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user