From a4fd2ca6bf0407160de199785207d13e6354ac48 Mon Sep 17 00:00:00 2001 From: Caio Ramos Casimiro Date: Tue, 26 Nov 2024 22:55:33 +0000 Subject: [PATCH] chore(morestyle) ignore wrapped lines with arguments following a declaration Handles the case when the expression defining a variable being declared is a function call receiving arguments that don't fit in the same line, e.g.: ngx_proxy_wasm_exec_t *pwexec = ngx_proxy_wasm_instance2pwexec( instance); --- util/morestyle.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util/morestyle.pl b/util/morestyle.pl index 16176e439..771dc1724 100755 --- a/util/morestyle.pl +++ b/util/morestyle.pl @@ -209,6 +209,10 @@ } elsif ($line =~ /^\s+[\+\-\*\/] [\s\w\(\)\+\-\*\/\.\-\>]/) { # ignoring line with a portion of a wrapped expression + } elsif ($line =~ /^\s+(\w+(, )?)+\);/) { + # ignoring line with arguments wrapped from previous line + # TODO: ensure arguments' leading spaces are correct + } elsif (!$cur_line_is_empty) { if ($n_vars > 0 && $min_var_space - $max_var_type > 3) { var_output "excessive spacing in variable alignment: needs 2 spaces from longest type to first name/pointer.";