Skip to content

Commit 299580c

Browse files
committed
Fix cppcheck filter to preserve trailing newline
Changed regex from .*\n+ to .*\n to remove the checkers report line while preserving the trailing newline.
1 parent 2962db6 commit 299580c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/test_hooks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ def run_integration_test(cmd_name, files, args, test_dir, target_output, target_
413413

414414
# Newer cppcheck versions include a checkers report info line
415415
if cmd_name == "cppcheck":
416-
output_actual = re.sub(rb"nofile:0:0: information: Active checkers.*\n+", b"", output_actual)
416+
output_actual = re.sub(rb"nofile:0:0: information: Active checkers.*\n", b"", output_actual)
417417

418418
utils.assert_equal(target_output, output_actual)
419419
assert target_retcode == actual_returncode
@@ -454,7 +454,7 @@ def run_shell_cmd(cmd_name, files, args, _, target_output, target_retcode):
454454
actual = re.sub(rb"[\d,]+ warnings and ", b"", actual)
455455
# Newer cppcheck versions include a checkers report info line
456456
if cmd_name == "cppcheck":
457-
actual = re.sub(rb"nofile:0:0: information: Active checkers.*\n+", b"", actual)
457+
actual = re.sub(rb"nofile:0:0: information: Active checkers.*\n", b"", actual)
458458
retcode = sp_child.returncode
459459
utils.assert_equal(target_output, actual)
460460
assert target_retcode == retcode

0 commit comments

Comments
 (0)