Parses and beautifies perl source
https://metacpan.org/dist/Perl-Tidy
This module makes the functionality of the perltidy utility available to
perl scripts. Any or all of the input parameters may be omitted, in which
case the @ARGV array will be used to provide input parameters as described
in the perltidy(1) man page.
- Sources inherited from project devel:languages:perl
- Devel package for openSUSE:Factory
- Links to openSUSE:Factory / perl-Perl-Tidy
- Download package
-
Checkout Package
osc -A https://api.opensuse.org checkout home:Tomcat42/perl-Perl-Tidy && cd $_
- Create Badge
Refresh
Refresh
Source Files
Filename | Size | Changed |
---|---|---|
Perl-Tidy-20230909.tar.gz | 0000987966 965 KB | |
_link | 0000000149 149 Bytes | |
cpanspec.yml | 0000000541 541 Bytes | |
perl-Perl-Tidy.changes | 0000086110 84.1 KB | |
perl-Perl-Tidy.spec | 0000003204 3.13 KB |
Revision 78 (latest revision is 87)
Dirk Stoecker (dstoecker)
accepted
request 1110564
from
Tina Müller (tinita)
(revision 78)
- 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.
Comments 0