From 203a2f5bc58c9570fd809b34dd0f92038d81bba2 Mon Sep 17 00:00:00 2001 From: Sergii Dymchenko Date: Wed, 7 Jun 2023 04:45:53 -0700 Subject: [PATCH] Codemod CLI: Print diff only when there is a change (#945) Otherwise lots of empty lines are printed. --- libcst/codemod/_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcst/codemod/_cli.py b/libcst/codemod/_cli.py index 91b85c4de..61e34e1c4 100644 --- a/libcst/codemod/_cli.py +++ b/libcst/codemod/_cli.py @@ -473,7 +473,7 @@ def _print_parallel_result( ) # In unified diff mode, the code is a diff we must print. - if unified_diff: + if unified_diff and result.code: print(result.code)