From ca2f9cdffc7d815df98121aff2e914f0714ec994 Mon Sep 17 00:00:00 2001 From: Pavol Juhas Date: Tue, 21 Mar 2023 11:27:03 -0700 Subject: [PATCH] Remove outdated workaround for a bug in black formatter The bug appears to be fixed in our required version of black per https://github.com/psf/black/issues/1629 --- check/format-incremental | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/check/format-incremental b/check/format-incremental index eca80ac4499..5ee15cfb70c 100755 --- a/check/format-incremental +++ b/check/format-incremental @@ -112,16 +112,8 @@ if (( only_print == 1 )); then args+=("--check" "--diff") fi -# Warn users about bug in black: https://github.com/psf/black/issues/1629 -# Once that is fixed upstream, we can just do: -# black "${args[@]}" "${format_files[@]}" -# exit $? -LOGS="$(black "${args[@]}" "${format_files[@]}" 2>&1)" +black "${args[@]}" "${format_files[@]}" BLACKSTATUS=$? -echo "${LOGS}" -if [[ "$BLACKSTATUS" == "123" && "$LOGS" =~ ^.*"INTERNAL ERROR: Black produced different code on the second pass of the formatter.".*$ ]]; then - echo -e "\033[31mWarning, it seems we ran into https://github.com/psf/black/issues/1629. Typically, this can be fixed by adding a trailing comma. If you get stuck, please file a cirq issue on github.\033[0m" -fi if [[ "$FLYNTSTATUS" != "0" || "$BLACKSTATUS" != "0" ]]; then exit 1