From 3f2d07df2d79d20c62826074ab83382af2c21d4b Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Sat, 23 Mar 2024 12:32:24 -0700 Subject: [PATCH] Operator **= now has spaces on both sides by default (c349) --- CHANGES.md | 5 +++++ lib/Perl/Tidy/Formatter.pm | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 945f92db..4570348a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,11 @@ ## 2024 02 02.02 + - The operator ``**=`` now has spaces on both sides by default. Previously, + there was no space on the left. This change makes its spacing the same + as all other assignment operators. The previous behavior can be obtained + with the parameter setting -nwls='**='. + - The option --file-size-order, or -fso is now the default. When perltidy is given a list of multiple filenames to process, they are sorted by size and processed in order of increasing size. diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index b36b0fbd..7353c06e 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -3010,7 +3010,7 @@ sub initialize_whitespace_hashes { my @spaces_both_sides = qw# + - * / % ? = . : x < > | & ^ .. << >> ** && .. || // => += -= .= %= x= &= |= ^= *= <> <= >= == =~ !~ /= != ... <<= >>= ~~ !~~ - &&= ||= //= <=> A k f w F n C Y U G v P S + **= &&= ||= //= <=> A k f w F n C Y U G v P S #; my @spaces_left_side = qw< @@ -3018,8 +3018,9 @@ sub initialize_whitespace_hashes { >; push( @spaces_left_side, '#' ); # avoids warning message + # c349: moved **= from @spaces_right_side to @spaces_both_sides my @spaces_right_side = qw< - ; } ) ] R J ++ -- **= + ; } ) ] R J ++ -- >; push( @spaces_right_side, ',' ); # avoids warning message -- 2.39.5