From 5d3dc8003e424afde103051a9e7bd4288a6c737b Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Sat, 30 Sep 2023 17:30:15 -0600 Subject: [PATCH] Make shfmt happier --- isort-and-black.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/isort-and-black.sh b/isort-and-black.sh index c4089c1..853908e 100755 --- a/isort-and-black.sh +++ b/isort-and-black.sh @@ -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 -