]> git.donarmstrong.com Git - perltidy.git/blobdiff - CHANGES.md
Update upstream source from tag 'upstream/20200110'
[perltidy.git] / CHANGES.md
index 523ae21cb392e1d9031780028cf3e4aeee6f2360..83034a5e0e607f18899ec56338afe3e2f82ae816 100644 (file)
@@ -1,5 +1,202 @@
 # Perltidy Change Log
 
+## 2020 01 10
+
+    - This release adds a flag to control the feature RT#130394 (allow short nested blocks)
+      introduced in the previous release.  Unfortunately that feature breaks 
+      RPerl installations, so a control flag has been introduced and that feature is now
+      off by default.  The flag is:
+
+      --one-line-block-nesting=n, or -olbn=n, where n is an integer as follows: 
+
+      -olbn=0 break nested one-line blocks into multiple lines [new DEFAULT]
+      -olbn=1 stable; keep existing nested-one line blocks intact [previous DEFAULT]
+
+      For example, consider this input line:
+
+        foreach (@list) { if ($_ eq $asked_for) { last } ++$found }
+
+      The new default behavior (-olbn=0), and behavior prior to version 20191203, is to break it into multiple lines:
+
+        foreach (@list) {
+            if ( $_ eq $asked_for ) { last }
+            ++$found;
+        }
+
+      To keep nested one-line blocks such as this on a single line you can add the parameter -olbn=1.
+
+    - Fixed issue RT#131288: parse error for un-prototyped constant function without parenthesized
+      call parameters followed by ternary.
+
+    - Fixed issue RT#131360, installation documentation.  Added a note that the binary 
+      'perltidy' comes with the Perl::Tidy module. They can both normally be installed with 
+      'cpanm Perl::Tidy'
+
+
+## 2019 12 03
+
+    - Fixed issue RT#131115: -bli option not working correctly.
+      Closing braces were not indented in some cases due to a glitch
+      introduced in version 20181120.
+
+    - Fixed issue RT#130394: Allow short nested blocks.  Given the following
+
+        $factorial = sub { reduce { $a * $b } 1 .. 11 };
+   
+      Previous versions would always break the sub block because it
+      contains another block (the reduce block).  The fix keeps
+      short one-line blocks such as this intact.
+
+    - Implement issue RT#130640: Allow different subroutine keywords.
+      Added a flag --sub-alias-list=s or -sal=s, where s is a string with
+      one or more aliases for 'sub', separated by spaces or commas.
+      For example,
+
+        perltidy -sal='method fun' 
+
+      will cause the perltidy to treat the words 'method' and 'fun' to be
+      treated the same as if they were 'sub'.
+
+    - Added flag --space-prototype-paren=i, or -spp=i, to control spacing 
+      before the opening paren of a prototype, where i=0, 1, or 2:
+      i=0 no space
+      i=1 follow input [current and default]
+      i=2 always space
+
+      Previously, perltidy always followed the input.
+      For example, given the following input 
+
+         sub usage();
+
+      The result will be:
+        sub usage();    # i=0 [no space]
+        sub usage();    # i=1 [default; follows input]
+        sub usage ();   # i=2 [space]
+
+    - Fixed issue git#16, minor vertical alignment issue.
+
+    - Fixed issue git#10, minor conflict of -wn and -ce
+
+    - Improved some vertical alignments involving two lines.
+
+
+## 2019 09 15
+
+    - fixed issue RT#130344: false warning "operator in print statement" 
+      for "use lib". 
+
+    - fixed issue RT#130304: standard error output should include filename.
+      When perltidy error messages are directed to the standard error output 
+      with -se or --standard-error-output, the message lines now have a prefix 
+      'filename:' for clarification in case multiple files 
+      are processed, where 'filename' is the name of the input file.  If 
+      input is from the standard input the displayed filename is '<stdin>', 
+      and if it is from a data structure then displayed filename 
+      is '<source_stream>'.
+
+    - implement issue RT#130425: check mode.  A new flag '--assert-tidy'
+      will cause an error message if the output script is not identical to
+      the input script. For completeness, the opposite flag '--assert-untidy'
+      has also been added.  The next item, RT#130297, insures that the script
+      will exit with a non-zero exit flag if the assertion fails.
+
+    - fixed issue RT#130297; the perltidy script now exits with a nonzero exit 
+      status if it wrote to the standard error output. Prevously only fatal
+      run errors produced a non-zero exit flag. Now, even non-fatal messages
+      requested with the -w flag will cause a non-zero exit flag.  The exit
+      flag now has these values:
+
+         0 = no errors
+         1 = perltidy could not run to completion due to errors
+         2 = perltidy ran to completion with error messages
+
+    - added warning message for RT#130008, which warns of conflicting input
+      parameters -iob and -bom or -boc.
+
+    - fixed RT#129850; concerning a space between a closing block brace and
+      opening bracket or brace, as occurs before the '[' in this line:
+
+       my @addunix = map { File::Spec::Unix->catfile( @ROOT, @$_ ) } ['b'];
+
+      Formerly, any space was removed. Now it is optional, and the output will
+      follow the input.
+
+    - fixed issue git#13, needless trailing whitespace in error message
+
+    - fixed issue git#9: if the -ce (--cuddled-else) flag is used,
+      do not try to form new one line blocks for a block type 
+      specified with -cbl, particularly map, sort, grep
+
+    - iteration speedup for unchanged code.  Previously, when iterations were
+      requested, at least two formatting passes were made. Now just a single pass
+      is made if the formatted code is identical to the input code.
+
+    - some improved vertical alignments
+
+## 2019 06 01
+
+    - rt #128477: Prevent inconsistent owner/group and setuid/setgid bits. 
+      In the -b (--backup-and-modify-in-place) mode, an attempt is made to set ownership
+      of the output file equal to the input file, if they differ.
+      In all cases, if the final output file ownership differs from input file, any setuid/setgid bits are cleared.
+
+    - Added option -bom  (--break-at-old-method-breakpoints) by
+      merrillymeredith which preserves breakpoints of method chains. Modified to also handle a cuddled call style.
+
+    - Merged patch to fix Windows EOL translation error with UTF-8 written by
+      Ron Ivy. This update prevents automatic conversion to 'DOS' CRLF line
+      endings.  Also, Windows system testing at the appveyor site is working again.
+
+    - RT #128280, added flag --one-line-block-semicolons=n (-olbs=n) 
+      to control semicolons in one-line blocks.  The values of n are:
+        n=0 means no semicolons termininating simple one-line blocks
+        n=1 means stable; do not change from input file [DEFAULT and current]
+        n=2 means always add semicolons in one-line blocks
+      The current behavior corresponds to the default n=1.
+
+    - RT #128216, Minor update to prevent inserting unwanted blank line at
+      indentation level change.  This should not change existing scripts.
+
+    - RT #81852: Improved indentation when quoted word (qw) lists are 
+      nested within other containers using the --weld-nested (-wn) flag.
+      The example given previously (below) is now closer to what it would
+      be with a simple list instead of qw:
+
+      # perltidy -wn
+      use_all_ok( qw{
+          PPI
+          PPI::Tokenizer
+          PPI::Lexer
+          PPI::Dumper
+          PPI::Find
+          PPI::Normal
+          PPI::Util
+          PPI::Cache
+      } );
+
+    - RT#12764, introduced new feature allowing placement of blanks around
+      sequences of selected keywords. This can be activated with the -kgb* 
+      series of parameters described in the manual.
+
+    - Rewrote vertical algnment module.  It is better at finding
+      patterns in complex code. For example,
+
+       OLD:
+           /^-std$/ && do { $std       = 1;     next; };
+           /^--$/   && do { @link_args = @argv; last; };
+           /^-I(.*)/ && do { $path = $1 || shift @argv; next; };
+
+       NEW:
+           /^-std$/  && do { $std       = 1;                 next; };
+           /^--$/    && do { @link_args = @argv;             last; };
+           /^-I(.*)/ && do { $path      = $1 || shift @argv; next; };
+
+    - Add repository URLs to META files 
+
+    - RT #118553, "leave only one newline at end of file". This option was not 
+      added because of undesirable side effects, but a new filter script
+      was added which can do this, "examples/delete_ending_blank_lines.pl".
+
 ## 2018 11 20
 
     - fix RT#127736 Perl-Tidy-20181119 has the EXE_FILES entry commented out in
 ## 2017 05 21
 
     - Fixed debian #862667: failure to check for perltidy.ERR deletion can lead 
-      to overwriting abritrary files by symlink attack. Perltidy was continuing 
+      to overwriting arbitrary files by symlink attack. Perltidy was continuing
       to write files after an unlink failure.  Thanks to Don Armstrong 
       for a patch.
 
       with --backup-and-modify-in-place. Thanks to Heinz Knutzen for this patch.
 
     - Fixed minor formatting issue where one-line blocks for subs with signatures 
-      were unnecesarily broken
+      were unnecessarily broken
 
     - RT #32905, patch to fix utf-8 error when output was STDOUT. 
 
     
      - Fixed RT #107832 and #106492, lack of vertical alignment of two lines
        when -boc flag (break at old commas) is set.  This bug was 
-       inadvertantly introduced in previous bug fix RT #98902. 
+       inadvertently introduced in previous bug fix RT #98902. 
 
      - Some common extensions to Perl syntax are handled better.
        In particular, the following snippet is now foratted cleanly:
     - Fixed RT #96101; Closing brace of anonymous sub in a list was being
       indented.  For example, the closing brace of the anonymous sub below 
       will now be lined up with the word 'callback'.  This problem 
-      occured if there was no comma after the closing brace of the anonymous sub.  
+      occurred if there was no comma after the closing brace of the anonymous sub.
       This update may cause minor changes to formatting of code with lists 
       of anonymous subs, especially TK code.
       
          : undef;
 
     -Text following un-parenthesized if/unless/while/until statements get a
-    full level of indentation.  Suggested by Jeff Armstorng and others. 
+    full level of indentation.  Suggested by Jeff Armstrong and others.
     OLD:
        return $ship->chargeWeapons("phaser-canon")
          if $encounter->description eq 'klingon'
      external calls to Tidy.pm module.  Fixed incorrect html title when
      Tidy.pm is called with IO::Scalar or IO::Array source.
 
-    -Output file permissons are now set as follows.  An output script file
+    -Output file permissions are now set as follows.  An output script file
      gets the same permission as the input file, except that owner
      read/write permission is added (otherwise, perltidy could not be
      rerun).  Html output files use system defaults.  Previously chmod 0755
     -I updated the tokenizer to allow $#+ and $#-, which seem to be new to
     Perl 5.6.  Some experimenting with a recent version of Perl indicated
     that it allows these non-alphanumeric '$#' array maximum index
-    varaibles: $#: $#- $#+ so I updated the parser accordingly.  Only $#:
+    variables: $#: $#- $#+ so I updated the parser accordingly.  Only $#:
     seems to be valid in older versions of Perl.
 
     -Fixed a rare formatting problem with -lp (and -gnu) which caused