Skip to content

Commit

Permalink
do not log positive files to analyze if no codemods ran
Browse files Browse the repository at this point in the history
  • Loading branch information
clavedeluna committed Mar 19, 2024
1 parent 3258da5 commit 5fd94c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/codemodder/codemodder.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,9 @@ def run(original_args) -> int:
)
codetf.write_report(argv.output)

log_report(context, argv, elapsed_ms, files_to_analyze)
log_report(
context, argv, elapsed_ms, [] if not codemods_to_run else files_to_analyze
)
return 0


Expand Down
2 changes: 2 additions & 0 deletions tests/test_codemodder.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ def test_codemod_include_no_match(self, write_report, info_logger, warning_logge
write_report.assert_called_once()

assert any("no codemods to run" in x[0][0] for x in info_logger.call_args_list)
assert any(x[0] == ("scanned: %s files", 0) for x in info_logger.call_args_list)

assert any(
f"Requested codemod to include'{bad_codemod}' does not exist." in x[0][0]
for x in warning_logger.call_args_list
Expand Down

0 comments on commit 5fd94c3

Please sign in to comment.