From 7897be6747dbb5a4aafeeb760e5fd408745e8604 Mon Sep 17 00:00:00 2001 From: Caio Ramos Casimiro Date: Fri, 3 May 2024 13:12:01 +0100 Subject: [PATCH] chore(morestyle) adapt spacing rule to multi-line wrapped expressions Accommodating the case when an expression following a variable declaration is wrapped into multiple lines, e.g.: size_t size = sizeof(ngx_wa_metrics_histogram_t) + sizeof(ngx_wa_metrics_bin_t) * metrics->config.max_histogram_bins; --- util/morestyle.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/morestyle.pl b/util/morestyle.pl index 130acf54c..7f37e7cc7 100755 --- a/util/morestyle.pl +++ b/util/morestyle.pl @@ -202,6 +202,8 @@ $var_line = $line; save_var(); + } elsif ($line =~ /^\s+[\+\-\*\/] [\s\w\(\)\+\-\*\/\.\-\>]/) { + # ignoring line with a portion of a wrapped expression } 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.";