From bb5cbfaa24958e7745a6a9169e347de7ab2bc535 Mon Sep 17 00:00:00 2001 From: Dhruv Manilawala Date: Wed, 11 May 2022 07:45:43 +0530 Subject: [PATCH] chore: remove temp workaround for libcst bug This was fixed in v0.4.2 --- pyproject.toml | 2 +- remove_print_statements.py | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 58ed390..e79dd30 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ classifiers = [ [tool.poetry.dependencies] python = "^3.7" -libcst = "^0.4.1" +libcst = "^0.4.2" # https://github.com/pallets/click/issues/2227 click = ">=8.1.1" diff --git a/remove_print_statements.py b/remove_print_statements.py index 6257b88..31eaee8 100644 --- a/remove_print_statements.py +++ b/remove_print_statements.py @@ -188,12 +188,9 @@ def check_file( with open(filename, "w") as f: f.write(result.code) elif isinstance(result, TransformFailure): - click.secho(f"Failed to transform the file {filename!r}: ", nl=False, fg="red") - try: - # FIXME: https://github.com/Instagram/LibCST/issues/678 - click.secho(result.error, fg="red") - except Exception: - pass + click.secho( + f"Failed to transform the file {filename!r}: {result.error}", fg="red" + ) report.failure_count += 1