Perltidy Change Log
+ 2013 09 22
+ - Fixed RT #88020. --converge was not working with wide characters.
+
+ - Fixed RT #78156. package NAMESPACE VERSION syntax not accepted.
+
+ - First attempt to fix RT #88588. INDEX END tag change in pod2html breaks
+ perltidy -html. I put in a patch which should work but I don't yet have
+ a way of testing it.
+
+ 2013 08 06
+ - Fixed RT #87107, spelling
+
+ 2013 08 05
+ - Fixed RT #87502, incorrect of parsing of smartmatch before hash brace
+
+ - Added feature request RT #87330, trim whitespace after POD.
+ The flag -trp (--trim-pod) will trim trailing whitespace from lines of POD
+
+ 2013 07 17
+ - Fixed RT #86929, #86930, missing lhs of assignment.
+
+ - Fixed RT #84922, moved pod from Tidy.pm into Tidy.pod
+
+ 2012 12 07
+ - The flag -cab=n or --comma-arrow-breakpoints=n has been generalized
+ to give better control over breaking open short containers. The
+ possible values are now:
+
+ n=0 break at all commas after =>
+ n=1 stable: break at all commas after => if container is open,
+ EXCEPT FOR one-line containers
+ n=2 break at all commas after =>, BUT try to form the maximum
+ maximum one-line container lengths
+ n=3 do not treat commas after => specially at all
+ n=4 break everything: like n=0 but also break a short container with
+ a => not followed by a comma
+ n=5 stable: like n=1 but ALSO break at open one-line containers (default)
+
+ New values n=4 and n=5 have been added to allow short blocks to be
+ broken open. The new default is n=5, stable. It should more closely
+ follow the breaks in the input file, and previously formatted code
+ should remain unchanged. If this causes problems use -cab=1 to recover
+ the former behavior. Thanks to Tony Maszeroski for the suggestion.
+
+ To illustrate the need for the new options, if perltidy is given
+ the following code, then the old default (-cab=1) was to close up
+ the 'index' container even if it was open in the source. The new
+ default (-cab=5) will keep it open if it was open in the source.
+
+ our $fancypkg = {
+ 'ALL' => {
+ 'index' => {
+ 'key' => 'value',
+ },
+ 'alpine' => {
+ 'one' => '+',
+ 'two' => '+',
+ 'three' => '+',
+ },
+ }
+ };
+
+ - New debug flag --memoize (-mem). This version contains a
+ patch supplied by Jonathan Swartz which can significantly speed up
+ repeated calls to Perl::Tidy::perltidy in a single process by caching
+ the result of parsing the formatting parameters. A factor of up to 10
+ speedup was achieved for masontidy (https://metacpan.org/module/masontidy).
+ The memoization patch is on by default but can be deactivated for
+ testing with -nmem (or --no-memoize).
+
+ - New flag -tso (--tight-secret-operators) causes certain perl operator
+ sequences (secret operators) to be formatted "tightly" (without spaces).
+ The most common of these are 0 + and + 0 which become 0+ and +0. The
+ operators currently modified by this flag are:
+ =( )= 0+ +0 ()x!! ~~<> ,=>
+ Suggested by by Philippe Bruhat. See https://metacpan.org/module/perlsecret
+ This flag is off by default.
+
+ - New flag -vmll (--variable-maximum-line-length) makes the maximum
+ line length increase with the nesting depth of a line of code.
+ Basically, it causes the length of leading whitespace to be ignored when
+ setting line breaks, so the formatting of a block of code is independent
+ of its nesting depth. Try this option if you have deeply nested
+ code or data structures, perhaps in conjunction with the -wc flag
+ described next. The default is not todo this.
+
+ - New flag -wc=n (--whitespace-cycle=n) also addresses problems with
+ very deeply nested code and data structures. When this parameter is
+ used and the nesting depth exceeds the value n, the leading whitespace
+ will be reduced and start at 1 again. The result is that deeply
+ nested blocks of code will shift back to the left. This occurs cyclically
+ to any nesting depth. This flag may be used either with or without -vmll.
+ The default is not to use this (-wc=0).
+
+ - Fixed RT #78764, error parsing smartmatch operator followed by anonymous
+ hash or array and then a ternary operator; two examples:
+
+ qr/3/ ~~ ['1234'] ? 1 : 0;
+ map { $_ ~~ [ '0', '1' ] ? 'x' : 'o' } @a;
+
+ - Fixed problem with specifying spaces around arrows using -wls='->'
+ and -wrs='->'. Thanks to Alain Valleton for documenting this problem.
+
+ - Implemented RT #53183, wishlist, lines of code with the same indentation
+ level which are contained with multiple stacked opening and closing tokens
+ (requested with flags -sot -sct) now have reduced indentation.
+
+ # Default
+ $sender->MailMsg(
+ {
+ to => $addr,
+ subject => $subject,
+ msg => $body
+ }
+ );
+
+ # OLD: perltidy -sot -sct
+ $sender->MailMsg( {
+ to => $addr,
+ subject => $subject,
+ msg => $body
+ } );
+
+ # NEW: perltidy -sot -sct
+ $sender->MailMsg( {
+ to => $addr,
+ subject => $subject,
+ msg => $body
+ } );
+
+ - New flag -act=n (--all-containers-tightness=n) is an abbreviation for
+ -pt=n -sbt=n -bt=n -bbt=n, where n=0,1, or 2. It simplifies input when all
+ containers have the same tightness. Using the same example:
+
+ # NEW: perltidy -sot -sct -act=2
+ $sender->MailMsg({
+ to => $addr,
+ subject => $subject,
+ msg => $body
+ });
+
+ - New flag -sac (--stack-all-containers) is an abbreviation for -sot -sct
+ This is part of wishlist item RT #53183. Using the same example again:
+
+ # NEW: perltidy -sac -act=2
+ $sender->MailMsg({
+ to => $addr,
+ subject => $subject,
+ msg => $body
+ });
+
+ - new flag -scbb (--stack-closing-block-brace) causes isolated closing
+ block braces to stack as in the following example. (Wishlist item RT#73788)
+
+ DEFAULT:
+ for $w1 (@w1) {
+ for $w2 (@w2) {
+ for $w3 (@w3) {
+ for $w4 (@w4) {
+ push( @lines, "$w1 $w2 $w3 $w4\n" );
+ }
+ }
+ }
+ }
+
+ perltidy -scbb:
+ for $w1 (@w1) {
+ for $w2 (@w2) {
+ for $w3 (@w3) {
+ for $w4 (@w4) {
+ push( @lines, "$w1 $w2 $w3 $w4\n" );
+ } } } }
+
+ There is, at present, no flag to place these closing braces at the end
+ of the previous line. It seems difficult to develop good rules for
+ doing this for a wide variety of code and data structures.
+
+ - Parameters defining block types may use a wildcard '*' to indicate
+ all block types. Previously it was not possible to include bare blocks.
+
+ - A flag -sobb (--stack-opening-block-brace) has been introduced as an
+ alias for -bbvt=2 -bbvtl='*'. So for example the following test code:
+
+ {{{{{{{ $testing }}}}}}}
+
+ cannot be formatted as above but can at least be kept vertically compact
+ using perltidy -sobb -scbb
+
+ { { { { { { { $testing
+ } } } } } } }
+
+ Or even, perltidy -sobb -scbb -i=1 -bbt=2
+ {{{{{{{$testing
+ }}}}}}}
+
+
+ - Error message improved for conflicts due to -pbp; thanks to Djun Kim.
+
+ - Fixed RT #80645, error parsing special array name '@$' when used as
+ @{$} or $#{$}
+
+ - Eliminated the -chk debug flag which was included in version 20010406 to
+ do a one-time check for a bug with multi-line quotes. It has not been
+ needed since then.
+
+ - Numerous other minor formatting improvements.
+
+ 2012 07 14
+ - Added flag -iscl (--ignore-side-comment-lengths) which causes perltidy
+ to ignore the length of side comments when setting line breaks,
+ RT #71848. The default is to include the length of side comments when
+ breaking lines to stay within the length prescribed by the -l=n
+ maximum line length parameter. For example,
+
+ Default behavior on a single line with long side comment:
+ $vmsfile =~ s/;[\d\-]*$//
+ ; # Clip off version number; we can use a newer version as well
+
+ perltidy -iscl leaves the line intact:
+
+ $vmsfile =~ s/;[\d\-]*$//; # Clip off version number; we can use a newer version as well
+
+ - Fixed RT #78182, side effects with STDERR. Error handling has been
+ revised and the documentation has been updated. STDERR can now be
+ redirected to a string reference, and perltidy now returns an
+ error flag instead of calling die when input errors are detected.
+ If the error flag is set then no tidied output was produced.
+ See man Perl::Tidy for an example.
+
+ - Fixed RT #78156, erroneous warning message for package VERSION syntax.
+
+ - Added abbreviations -conv (--converge) to simplify iteration control.
+ -conv is equivalent to -it=4 and will insure that the tidied code is
+ converged to its final state with the minimum number of iterations.
+
+ - Minor formatting modifications have been made to insure convergence.
+
+ - Simplified and hopefully improved the method for guessing the starting
+ indentation level of entabbed code. Added flag -dt=n (--default_tabsize=n)
+ which might be helpful if the guessing method does not work well for
+ some editors.
+
+ - Added support for stacked labels, upper case X/B in hex and binary, and
+ CORE:: namespace.
+
+ - Eliminated warning messages for using keyword names as constants.
+
2012 07 01
- Corrected problem introduced by using a chomp on scalar references, RT #77978
parameter is quoted. For example, to define -sphb=# it used to be necessary
to write
-sbcp='#'
- to keep the # from becomming part of a comment. This was causing
+ to keep the # from becoming part of a comment. This was causing
trouble for new users. Now it can also be written without quotes:
-sbcp=#
-Corrected minor, uncommon bug found during routine testing, in which a
blank got inserted between a function name and its opening paren after
a file test operator, but only in the case that the function had not
- been previously seen. Perl uses the existance (or lack thereof) of
+ been previously seen. Perl uses the existence (or lack thereof) of
the blank to guess if it is a function call. That is,
if (-l pid_filename()) {
became
braces, while a new parameter -bbt (block-brace-tightness) applies to
curly braces which contain code BLOCKS. The default value is -bbt=0.
- -added flag -icp (--indent-closing-paren) which leaves a statment
+ -added flag -icp (--indent-closing-paren) which leaves a statement
termination of the form );, };, or ]; indented with the same
indentation as the previous line. For example,