Skip to content

Commit 5658670

Browse files
committed
Fix Windows cppcheck trailing newline and macOS uncrustify config
Two platform-specific fixes: 1. Normalize cppcheck trailing newlines on Windows (extra newline added) 2. Remove deprecated sp_balance_nested_parens option from uncrustify config (already have sp_paren_paren defined later in the file)
1 parent 93b5ca3 commit 5658670

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

tests/test_hooks.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,8 @@ def run_shell_cmd(cmd_name, files, args, _, target_output, target_retcode):
458458
# Newer cppcheck versions include a checkers report info line
459459
if cmd_name == "cppcheck":
460460
actual = re.sub(rb"\nnofile:0:0: information: Active checkers.*\n+", b"\n", actual)
461+
# Windows cppcheck adds extra trailing newline
462+
actual = actual.rstrip(b"\n") + b"\n" if actual.endswith(b"\n") else actual
461463
# Windows clang uses return-mismatch instead of return-type
462464
if cmd_name in ["clang-tidy", "include-what-you-use"]:
463465
actual = actual.replace(b"clang-diagnostic-return-mismatch", b"clang-diagnostic-return-type")

tests/uncrustify_defaults.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ indent_bool_paren=0
2424
indent_square_nl=false
2525
indent_preserve_sql=false
2626
indent_align_assign=true
27-
sp_balance_nested_parens=false
2827
align_keep_tabs=false
2928
align_with_tabs=false
3029
align_on_tabstop=false

0 commit comments

Comments
 (0)