Skip to content

Commit b42ef33

Browse files
committed
refactor: remove noisy command logging from action output
Remove the 'commit-check --message' command lines that were being printed to the action log for every check invocation. The results are already visible in the job summary and PR comments — the command echo was debug cruft that created noise, especially when checking many individual commits in a PR.
1 parent 0aa5d60 commit b42ef33

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

‎main.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ def run_check_command(
151151
) -> int:
152152
"""Run commit-check and write both stdout and stderr to the result file."""
153153
command = ["commit-check"] + args
154-
print(" ".join(command))
155154
result = subprocess.run(
156155
command,
157156
input=input_text,
@@ -250,7 +249,6 @@ def run_commit_check() -> int:
250249
if emitted_failure_output:
251250
cmd_args.append("--no-banner")
252251
output_prefix = "\n--- PR Title ---\n"
253-
print("--- PR title check ---")
254252
rc = run_check_command(
255253
cmd_args,
256254
result_file,

‎main_test.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,11 @@ def test_with_input_uses_text_mode(self):
152152
self.assertEqual(mock_run.call_args[1]["input"], "fix: demo")
153153
self.assertTrue(mock_run.call_args[1]["text"])
154154

155-
def test_prints_command(self):
155+
def test_success_returns_zero(self):
156156
mock_result = MagicMock(returncode=0, stdout="")
157157
with patch("main.subprocess.run", return_value=mock_result):
158-
with patch("builtins.print") as mock_print:
159-
main.run_check_command(["--branch"], io.StringIO())
160-
mock_print.assert_called_once_with("commit-check --branch")
158+
rc = main.run_check_command(["--branch"], io.StringIO())
159+
self.assertEqual(rc, 0)
161160

162161

163162
class TestRunPrMessageChecks(unittest.TestCase):

0 commit comments

Comments
 (0)