Skip to content

Commit

Permalink
chore(morestyle) ignore wrapped lines with arguments following a decl…
Browse files Browse the repository at this point in the history
…aration

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);
  • Loading branch information
casimiro committed Nov 27, 2024
1 parent e86f7fe commit 9910a5b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions util/morestyle.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
Expand Down

0 comments on commit 9910a5b

Please sign in to comment.