Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not log positive files to analyze if no codemods ran #392

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading