Teach it about isort in addition to black
The design of this is starting to break down now and will need to be reworked a bit.
This commit is contained in:
@@ -26,7 +26,7 @@ if [[ $file_type == "javascript" || \
|
|||||||
retval="$?"
|
retval="$?"
|
||||||
success_retval=0
|
success_retval=0
|
||||||
elif [[ $file_type == "python" ]]; then
|
elif [[ $file_type == "python" ]]; then
|
||||||
out=$(pipx run black $file 2>/dev/null)
|
out=$(pipx run black $file 2>/dev/null && pipx run isort $file 2>/dev/null)
|
||||||
retval="$?"
|
retval="$?"
|
||||||
success_retval=0
|
success_retval=0
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -28,11 +28,20 @@ if [[ $file_type = "javascript" || \
|
|||||||
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=$(pipx run black --check $file 2>/dev/null)
|
|
||||||
retval="$?"
|
out=$(pipx run isort --check $file 2>/dev/null)
|
||||||
|
isort_retval="$?"
|
||||||
|
|
||||||
success_retval=0
|
success_retval=0
|
||||||
would_reformat_retval=1
|
would_reformat_retval=1
|
||||||
syntax_error_retval=123
|
syntax_error_retval=123
|
||||||
|
|
||||||
|
if [[ x"$isort_retval" = x"0" ]] ; then
|
||||||
|
out=$(pipx run black --check $file 2>/dev/null)
|
||||||
|
retval="$?"
|
||||||
|
else
|
||||||
|
retval="$isort_retval"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo -n "ignoring"
|
echo -n "ignoring"
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user