Extract isort and black
This commit is contained in:
@@ -19,6 +19,8 @@ file_type=$(sniff_file_type $file)
|
||||
|
||||
wrflog got file_type $file_type
|
||||
|
||||
WOULD_REFORMAT=would_reformat
|
||||
|
||||
if [[ $file_type = "javascript" || \
|
||||
$file_type = "vue" || \
|
||||
$file_type = "typescript" || \
|
||||
@@ -39,20 +41,11 @@ wrflog "prettier: $(ls -l $(wfroot $DIR)/./prettier.sh)"
|
||||
would_reformat_retval=1
|
||||
syntax_error_retval=2
|
||||
elif [[ $file_type == "python" ]]; then
|
||||
|
||||
out=$(pipx run isort --check $file 2>/dev/null)
|
||||
isort_retval="$?"
|
||||
|
||||
out=$($(wfroot $DIR)/./isort-and-black.sh $file 2>&1 > /dev/null)
|
||||
retval="$?"
|
||||
success_retval=0
|
||||
would_reformat_retval=1
|
||||
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
|
||||
syntax_error_retval=2
|
||||
elif [[ $file_type == "golang" ]] ; then
|
||||
success_retval=0
|
||||
would_reformat_retval=1
|
||||
|
||||
Reference in New Issue
Block a user