Overview

Request 1110564 accepted

- updated to 20230909
see /usr/share/doc/packages/perl-Perl-Tidy/CHANGES.md
## 2023 09 09
- Added new parameters -wme, or --warn-missing-else, and -ame,
or --add-missing else. The parameter -wme tells perltidy to issue
a warning if an if-elsif-... chain does not end in an else block.
The parameter -ame tells perltidy to insert an else block at the
end of such a chain if there is none.
For example, given the following snippet:
if ( $level == 3 ) { $val = $global{'section'} }
elsif ( $level == 2 ) { $val = $global{'chapter'} }
# perltidy -ame
if ( $level == 3 ) { $val = $global{'section'} }
elsif ( $level == 2 ) { $val = $global{'chapter'} }
else {
##FIXME - added with perltidy -ame
}
The resulting code should be carefully reviewed, and the ##FIXME comment
should be updated as appropriate. The text of the ##FIXME comment can be
changed with parameter -amec=s, where 's' is the comment to mark the new
else block. The man pages have more details.
- The syntax of the parameter --use-feature=class, or -uf=class, which
new in the previous release, has been changed slightly for clarity.
The default behavior, which occurs if this flag is not entered, is
to automatically try to handle both old and new uses of the keywords
'class', 'method', 'field', and 'ADJUST'.
To force these keywords to only follow the -use feature 'class' syntax,
enter --use-feature=class.
To force perltidy to ignore the -use feature 'class' syntax, enter
--use-feature=noclass.
- Issue git #122. Added parameter -lrt=n1:n2, or --line-range-tidy=n1:n2
to limit tidy operations to a limited line range. Line numbers start
with 1. This parameter is mainly of interest to editing programs which
drive perltidy. The man pages have details.
- Some fairly rare instances of incorrect spacing have been fixed. The
problem was that the tokenizer being overly conservative in marking
terms as possible filehandles or indirect objects. This causes the space
after the possible filehandle to be frozen to its input value in order not
to introduce an error in case Perl had to guess. The problem was fixed
by having the tokenizer look ahead for operators which can eliminate the
uncertainty. To illustrate, in the following line the term ``$d`` was
previously marked as a possible filehandle, so no space was added after it.
print $d== 1 ? " [ON]\n" : $d ? " [$d]\n" : "\n";
^
In the current version, the next token is seen to be an equality, so
``$d`` is marked as an ordinary identifier and normal spacing rules
can apply:
print $d == 1 ? " [ON]\n" : $d ? " [$d]\n" : "\n";
^
- This version runs 7 to 10 percent faster than the previous release on
large files, depending on options and file type. Much of the gain comes
from streamlined I/O operations.
- This version was stress-tested for many cpu hours with random
input parameters. No failures to converge, internal fault checks,
undefined variable references or other irregularities were seen.

Request History
Tina Müller's avatar

tinita created request

- updated to 20230909
see /usr/share/doc/packages/perl-Perl-Tidy/CHANGES.md
## 2023 09 09
- Added new parameters -wme, or --warn-missing-else, and -ame,
or --add-missing else. The parameter -wme tells perltidy to issue
a warning if an if-elsif-... chain does not end in an else block.
The parameter -ame tells perltidy to insert an else block at the
end of such a chain if there is none.
For example, given the following snippet:
if ( $level == 3 ) { $val = $global{'section'} }
elsif ( $level == 2 ) { $val = $global{'chapter'} }
# perltidy -ame
if ( $level == 3 ) { $val = $global{'section'} }
elsif ( $level == 2 ) { $val = $global{'chapter'} }
else {
##FIXME - added with perltidy -ame
}
The resulting code should be carefully reviewed, and the ##FIXME comment
should be updated as appropriate. The text of the ##FIXME comment can be
changed with parameter -amec=s, where 's' is the comment to mark the new
else block. The man pages have more details.
- The syntax of the parameter --use-feature=class, or -uf=class, which
new in the previous release, has been changed slightly for clarity.
The default behavior, which occurs if this flag is not entered, is
to automatically try to handle both old and new uses of the keywords
'class', 'method', 'field', and 'ADJUST'.
To force these keywords to only follow the -use feature 'class' syntax,
enter --use-feature=class.
To force perltidy to ignore the -use feature 'class' syntax, enter
--use-feature=noclass.
- Issue git #122. Added parameter -lrt=n1:n2, or --line-range-tidy=n1:n2
to limit tidy operations to a limited line range. Line numbers start
with 1. This parameter is mainly of interest to editing programs which
drive perltidy. The man pages have details.
- Some fairly rare instances of incorrect spacing have been fixed. The
problem was that the tokenizer being overly conservative in marking
terms as possible filehandles or indirect objects. This causes the space
after the possible filehandle to be frozen to its input value in order not
to introduce an error in case Perl had to guess. The problem was fixed
by having the tokenizer look ahead for operators which can eliminate the
uncertainty. To illustrate, in the following line the term ``$d`` was
previously marked as a possible filehandle, so no space was added after it.
print $d== 1 ? " [ON]\n" : $d ? " [$d]\n" : "\n";
^
In the current version, the next token is seen to be an equality, so
``$d`` is marked as an ordinary identifier and normal spacing rules
can apply:
print $d == 1 ? " [ON]\n" : $d ? " [$d]\n" : "\n";
^
- This version runs 7 to 10 percent faster than the previous release on
large files, depending on options and file type. Much of the gain comes
from streamlined I/O operations.
- This version was stress-tested for many cpu hours with random
input parameters. No failures to converge, internal fault checks,
undefined variable references or other irregularities were seen.


Dirk Stoecker's avatar

dstoecker accepted request

openSUSE Build Service is sponsored by