]> git.donarmstrong.com Git - perltidy.git/commitdiff
make --delete-repeated-commas the default
authorSteve Hancock <perltidy@users.sourceforge.net>
Wed, 14 Feb 2024 15:53:17 +0000 (07:53 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Wed, 14 Feb 2024 15:53:17 +0000 (07:53 -0800)
CHANGES.md
bin/perltidy
lib/Perl/Tidy.pm
t/snippets/drc.par
t/snippets/expect/drc.def
t/snippets/expect/drc.drc
t/snippets26.t

index 719c42c89fa977ac17519c75084fffa45acfc825..d94ae8f841b2998012a2a51cd113f3006c7fcb17 100644 (file)
@@ -2,16 +2,20 @@
 
 ## 2024 02 02.01
 
-    - The option --delete-repeated-commas, -drc has been expanded as follows:
+    - The option --delete-repeated-commas is now the default.
+
+      It makes the following checks and changes:
       - Repeated commas like ',,' on the same line are removed with a warning
       - Repeated fat commas like '=> =>' on the same line are removed with a
         warning
-      - Repeated commas and fat commas on different lines remain unchanged
-        but produce a warning
+      - Repeated commas and fat commas on different lines remain unchanged but
+        produce a warning (to avoid promoting a side-comment to block comment)
       - The combination '=>,' produces a warning but is not changed (it is
-        likely a serious error but only its author would know how to fix it).
-      These warnings are only output if the --warnings flag is set.
-      The -drc option is off by default; this could change in the future.
+        likely an error but only its author would know how to fix it).
+      These warnings are only output if the --warning-output, -w flag is set.
+
+      This is now the DEFAULT Behavior.
+      To avoid this change, use --nodelete-repeated-commas, or -ndrc.
 
     - Added control --delete-interbracket-arrows, or -dia, to delete optional
       hash ref and array ref arrows between brackets as in the following
index 9048ee4e2df91787a534dcfb9c43a1aee042c51d..cc44d3e9edca2a28813adac510a78435463303d7 100755 (executable)
@@ -3731,8 +3731,8 @@ likely an error but only its author would know how to fix it).
 
 =item *
 
-Note that the special combination ',=>' ('winking fat comma') is ignored
-by this parameter.
+Note that the remaining combination ',=>' (sometimes called a
+'winking fat comma') is ignored by this parameter.
 
 =item *
 
@@ -3740,7 +3740,7 @@ These warnings are only output if the B<-w> flag is set.
 
 =back
 
-This feature is currently off by default and must be requested.
+This feature is on by default.  Use B<-ndrc> to turn it off.
 
 =item B<--want-trailing-commas=s> or B<-wtc=s>, B<--add-trailing-commas> or B<-atc>, and B<--delete-trailing-commas> or B<-dtc>
 
index 5d0f56246b9a3269c621d213f09366fd414b914a..b8abb0a0a51ef35be34367747e366925de3b263d 100644 (file)
@@ -3833,6 +3833,7 @@ sub generate_options {
       noextended-continuation-indentation
       cuddled-break-option=1
       delete-old-newlines
+      delete-repeated-commas
       delete-semicolons
       dump-block-minimum-lines=20
       dump-block-types=sub
index 569122054749a905473392c8441a2fda5851b80b..4b7a06138cb71798a1d48245df233c1ca965663f 100644 (file)
@@ -1 +1 @@
--drc
+-ndrc
index 5c8897dc9c6b8c12a3eec4700850f846ab1619d9..f47324b002d93b364f422c9053c9556ab9d907e9 100644 (file)
@@ -1 +1 @@
-ignoreSpec( $file, "file",, \%spec,,, \%Rspec );
+ignoreSpec( $file, "file", \%spec, \%Rspec );
index f47324b002d93b364f422c9053c9556ab9d907e9..5c8897dc9c6b8c12a3eec4700850f846ab1619d9 100644 (file)
@@ -1 +1 @@
-ignoreSpec( $file, "file", \%spec, \%Rspec );
+ignoreSpec( $file, "file",, \%spec,,, \%Rspec );
index e4351228aee47f5280c30daaabb736abaf19ed9d..cb1bb49597bde31fab499092b43130fa93403298 100644 (file)
@@ -46,7 +46,7 @@ BEGIN {
 --code-skipping-end='#>>V'
 ----------
         'def'    => "",
-        'drc'    => "-drc",
+        'drc'    => "-ndrc",
         'git106' => "-xlp -gnu -xci",
         'git108' => "-wn -wfc",
         'git93'  => <<'----------',
@@ -632,7 +632,7 @@ $r = $c->
             source => "drc",
             params => "def",
             expect => <<'#9...........',
-ignoreSpec( $file, "file",, \%spec,,, \%Rspec );
+ignoreSpec( $file, "file", \%spec, \%Rspec );
 #9...........
         },
 
@@ -640,7 +640,7 @@ ignoreSpec( $file, "file",, \%spec,,, \%Rspec );
             source => "drc",
             params => "drc",
             expect => <<'#10...........',
-ignoreSpec( $file, "file", \%spec, \%Rspec );
+ignoreSpec( $file, "file",, \%spec,,, \%Rspec );
 #10...........
         },