2010-04-29 14:44:44 +00:00
|
|
|
#
|
2011-11-18 11:34:45 +00:00
|
|
|
# spec file for package perl-Perl-Tidy
|
2010-04-29 14:44:44 +00:00
|
|
|
#
|
Accepting request 1236689 from devel:languages:perl:autoupdate
- updated to 20250105.0.0 (20250105)
see /usr/share/doc/packages/perl-Perl-Tidy/CHANGES.md
## 2025 01 05
- If a file consists only of comments, then the starting indentation will
be guessed from the indentation of the first comment. Previously it would
be guessed to be zero. Parameter --starting-indentation-level=n can be
used to specify an indentation and avoid a guess. This issue can
arise when formatting a block of comments from within an editor.
- Added missing 'use File::Temp' for -html option. This was causing the
message: "Undefined subroutine &File::Temp::tempfile called at ..."
See git #176.
- A new parameter --dump-unique-keys, or -duk, dumps a list of hash keys
which appear to be used just once, and do not appear among the quoted
strings in a file. For example:
perltidy -duk File.pm >output.txt
This can help locate misspelled hash keys.
- Line breaks at long chains of method calls now break at all calls
with args in parens, as in this example from git #171
# Old default
sub bla_p( $value = 42 ) {
return Mojo::Promise->resolve($value)->then( sub { shift() / 2 } )
->then( sub { shift() + 6 } )->then( sub { shift() / 2 } )
->catch( sub { warn shift } );
}
# New default
sub bla_p( $value = 42 ) {
return Mojo::Promise->resolve($value)
->then( sub { shift() / 2 } )
->then( sub { shift() + 6 } )
->then( sub { shift() / 2 } )
->catch( sub { warn shift } );
}
- Parameter --break-at-old-method-breakpoints, or -bom, has been
updated to insure that it only applies to lines beginning with
method calls, as intended. Line breaks for all lines beginning with
'->', even non-method calls, can be retained by using
--keep-old-breakpoints_before='->'.
- Added parameter --multiple-token-tightness=s, or -mutt=s.
The default value --paren-tightness=1 adds space within the parens
if, and only if, the container holds multiple tokens. Some perltidy
tokens may be rather long, and it can be preferable to also space some of
them as if they were multiple tokens. This can be done with this parameter,
and it applies to parens as well as square brackets and curly braces.
For example, the default below has no space within the square brackets:
# perltidy
my $rlist = [qw( alpha beta gamma )];
Spaces can be obtained with:
# perltidy -mutt='q*'
my $rlist = [ qw( alpha beta gamma ) ];
The parameter -mutt='q*' means treat qw and similar quote operators as
multiple tokens. The manual has details; git #120 has another example.
- Added parameter --indent-leading-semicolon, -ils; see git #171. When
this is negated, a line with a leading semicolon does not get the extra
leading continuation indentation spaces (defined with -ci=n).
- Space around here doc delimiters follow spacing controls better. For
example, a space is now added before the closing paren here:
OLD: (without the here doc):
push( @script, <<'EOT');
NEW:
push( @script, <<'EOT' );
Also, any spaces between the '<<' and here target are removed (git #174):
OLD:
push( @script, << 'EOT');
NEW:
push( @script, <<'EOT' );
- Added parameter --break-at-trailing-comma-types=s, or -btct=s, where
s is a string which selects trailing commas. For example, -btct='f(b'
places a line break after all bare trailing commas in function calls.
The manual has details.
- Fix git #165, strings beginning with v before => gave an incorrect error
message.
- The parameter --add-lone-trailing-commas, -altc, is now on by default.
This will simplify input for trailing comma operations. Use
--noadd-lone-trailing-commas, or -naltc to turn it off.
- More edge cases for adding and deleting trailing commas are now handled
(git #156).
- A problem has been fixed in which the addition or deletion of trailing
commas with the -atc or -dtc flags did not occur due to early convergence
when the -conv flag was set (git #143).
- Added parameter --qw-as-function, or -qwaf, discussed in git #164.
When this parameter is set, a qw list which begins with 'qw(' is
formatted as if it were a function call with call args being a list
of comma-separated quoted items. For example, given this input:
@fields = qw( $st_dev $st_ino $st_mode $st_nlink $st_uid
$st_gid $st_rdev $st_size $st_atime $st_mtime $st_ctime
$st_blksize $st_blocks);
# perltidy -qwaf
@fields = qw(
$st_dev $st_ino $st_mode $st_nlink
$st_uid $st_gid $st_rdev $st_size
$st_atime $st_mtime $st_ctime $st_blksize
$st_blocks
);
OBS-URL: https://build.opensuse.org/request/show/1236689
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Perl-Tidy?expand=0&rev=90
2025-01-13 21:45:07 +00:00
|
|
|
# Copyright (c) 2025 SUSE LLC
|
2010-04-29 14:44:44 +00:00
|
|
|
#
|
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
2018-12-06 16:17:10 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2010-10-13 23:13:00 +00:00
|
|
|
#
|
|
|
|
|
|
2010-12-19 13:07:54 +00:00
|
|
|
|
Accepting request 862581 from devel:languages:perl:autoupdate
- updated to 20210111
see /usr/share/doc/packages/perl-Perl-Tidy/CHANGES.md
## 2021 01 11
- Fixed issue git #49, -se breaks warnings exit status behavior.
The exit status flag was not always being set when the -se flag was set.
- Some improvements have been made in the method for aligning side comments.
One of the problems that was fixed is that there was a tendency for side comment
placement to drift to the right in long scripts. Programs with side comments
may have a few changes.
- Some improvements have been made in formatting qw quoted lists. This
fixes issue git #51, in which closing qw pattern delimiters not always
following the settings specified by the --closing-token-indentation=n settings.
Now qw closing delimiters ')', '}' and ']' follow these flags, and the
delimiter '>' follows the flag for ')'. Other qw pattern delimiters remain
indented as the are now. This change will cause some small formatting changes
in some existing programs.
- Another change involving qw lists is that they get full indentation,
rather than just continuation indentation, if
(1) the closing delimiter is one of } ) ] > and is on a separate line,
(2) the opening delimiter (i.e. 'qw{' ) is also on a separate line, and
(3) the -xci flag (--extended-continuation-indentation) is set.
This improves formatting when qw lists are contained in other lists. For example,
# OLD: perltidy
foreach $color (
qw(
AntiqueWhite3 Bisque1 Bisque2 Bisque3 Bisque4
SlateBlue3 RoyalBlue1 SteelBlue2 DeepSkyBlue3
),
qw(
LightBlue1 DarkSlateGray1 Aquamarine2 DarkSeaGreen2
SeaGreen1 Yellow1 IndianRed1 IndianRed2 Tan1 Tan4
)
)
# NEW, perltidy -xci
foreach $color (
qw(
AntiqueWhite3 Bisque1 Bisque2 Bisque3 Bisque4
SlateBlue3 RoyalBlue1 SteelBlue2 DeepSkyBlue3
),
qw(
LightBlue1 DarkSlateGray1 Aquamarine2 DarkSeaGreen2
SeaGreen1 Yellow1 IndianRed1 IndianRed2 Tan1 Tan4
)
)
- Some minor improvements have been made to the rules for formatting
some edge vertical alignment cases, usually involving two dissimilar lines.
- A more complete list of updates is at
https://github.com/perltidy/perltidy/blob/master/local-docs/BugLog.pod
OBS-URL: https://build.opensuse.org/request/show/862581
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Perl-Tidy?expand=0&rev=62
2021-01-12 12:05:10 +00:00
|
|
|
%define cpan_name Perl-Tidy
|
2010-10-13 23:13:00 +00:00
|
|
|
Name: perl-Perl-Tidy
|
Accepting request 1288028 from devel:languages:perl:autoupdate
- updated to 20250616.0.0 (20250616)
see /usr/share/doc/packages/perl-Perl-Tidy/CHANGES.md
## 2025 06 16
- Added support for the assigning logical xor ^^= operator
- For input parameters which allow a paren type to be selected, the
selection 'f' (function call) now includes functions called with
a direct arrow before the paren, '->('. This was an oversight which
has been corrected.
- A new parameter --break-at-old-comma-types=s, or -boct=s, allows the
parameter --break-at-old-comma-breakpoints (-boc) to be limited to
selected container types. For example, -boc -boct='f(' means break
at old commas but only if they are function call lists.
- A new parameter --cuddled-paren-brace-weld, or -cpbw, has been added to
handle issue git #184. This modifies --cuddled-paren-brace by
preventing a paren and following brace from getting separated in
certain situations. The difference is illustrated here:
# perltidy -cpb alone has no effect for this short snippet:
if ( $Kouter_opening == $Kfirst
&& $has_tight_paren{$type_prev} )
{
$Kref = $Kprev;
}
# perltidy -cpb -cpbw keeps the closing paren next to the opening brace:
if (
$Kouter_opening == $Kfirst
&& $has_tight_paren{$type_prev}
) {
$Kref = $Kprev;
}
- The parameter --maximum-fields-per-table, or -mft, now accepts a string
input which can limit its application to certain containers. For
example, -mft='f(1' means that function call lists should be formatted
with just 1 item per line. It has no effect on other tables. The
manual has further information.
- Add option --break-open-compact-parens=s, discussed in git #78.
This changes the default formatting for lists which would normally
be displayed compactly on two lines. It causes them to be formatted
in the same way as long lists, with line breaks at the opening and
closing parentheses.
- Add option --skip-formatting-except-id=NAME, or -sfei=NAME, discussed
in git #183. This allows formatting to apply only to lines tagged
with #<<< id=NAME, where NAME is a user-defined tag. The special
variation -sfei='-' can be used to run perltidy with full checking
but without any formatting changes.
- A relatively rare problem with the formatting combination -xci and -lp or
-xlp has been fixed. Some lines had more leading spaces that intended.
- New option -m added to --dump-mismatched-returns and
--warn-mismatched-returns. This checks for multiple array
return sizes. A warning occurs when a sub has multiple returns
of finite lists with different counts greater than 1, and
not all of them are matched with calls.
- Improved support for Object::Pad, see git #182.
- A limitation on the treatment of lexical subs has been fixed. Previously,
a lexical sub with the same name as a quote operator would produce a warning,
and might cause a tokenization error.
- Here targets in quotes are now located and handled correctly.
OBS-URL: https://build.opensuse.org/request/show/1288028
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Perl-Tidy?expand=0&rev=96
2025-06-24 07:16:01 +00:00
|
|
|
Version: 20250616.0.0
|
2013-07-27 12:44:22 +00:00
|
|
|
Release: 0
|
Accepting request 1288028 from devel:languages:perl:autoupdate
- updated to 20250616.0.0 (20250616)
see /usr/share/doc/packages/perl-Perl-Tidy/CHANGES.md
## 2025 06 16
- Added support for the assigning logical xor ^^= operator
- For input parameters which allow a paren type to be selected, the
selection 'f' (function call) now includes functions called with
a direct arrow before the paren, '->('. This was an oversight which
has been corrected.
- A new parameter --break-at-old-comma-types=s, or -boct=s, allows the
parameter --break-at-old-comma-breakpoints (-boc) to be limited to
selected container types. For example, -boc -boct='f(' means break
at old commas but only if they are function call lists.
- A new parameter --cuddled-paren-brace-weld, or -cpbw, has been added to
handle issue git #184. This modifies --cuddled-paren-brace by
preventing a paren and following brace from getting separated in
certain situations. The difference is illustrated here:
# perltidy -cpb alone has no effect for this short snippet:
if ( $Kouter_opening == $Kfirst
&& $has_tight_paren{$type_prev} )
{
$Kref = $Kprev;
}
# perltidy -cpb -cpbw keeps the closing paren next to the opening brace:
if (
$Kouter_opening == $Kfirst
&& $has_tight_paren{$type_prev}
) {
$Kref = $Kprev;
}
- The parameter --maximum-fields-per-table, or -mft, now accepts a string
input which can limit its application to certain containers. For
example, -mft='f(1' means that function call lists should be formatted
with just 1 item per line. It has no effect on other tables. The
manual has further information.
- Add option --break-open-compact-parens=s, discussed in git #78.
This changes the default formatting for lists which would normally
be displayed compactly on two lines. It causes them to be formatted
in the same way as long lists, with line breaks at the opening and
closing parentheses.
- Add option --skip-formatting-except-id=NAME, or -sfei=NAME, discussed
in git #183. This allows formatting to apply only to lines tagged
with #<<< id=NAME, where NAME is a user-defined tag. The special
variation -sfei='-' can be used to run perltidy with full checking
but without any formatting changes.
- A relatively rare problem with the formatting combination -xci and -lp or
-xlp has been fixed. Some lines had more leading spaces that intended.
- New option -m added to --dump-mismatched-returns and
--warn-mismatched-returns. This checks for multiple array
return sizes. A warning occurs when a sub has multiple returns
of finite lists with different counts greater than 1, and
not all of them are matched with calls.
- Improved support for Object::Pad, see git #182.
- A limitation on the treatment of lexical subs has been fixed. Previously,
a lexical sub with the same name as a quote operator would produce a warning,
and might cause a tokenization error.
- Here targets in quotes are now located and handled correctly.
OBS-URL: https://build.opensuse.org/request/show/1288028
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Perl-Tidy?expand=0&rev=96
2025-06-24 07:16:01 +00:00
|
|
|
# 20250616 -> normalize -> 20250616.0.0
|
|
|
|
|
%define cpan_version 20250616
|
2019-06-02 11:08:23 +00:00
|
|
|
#Upstream: GPL-1.0-or-later
|
2018-02-19 07:21:38 +00:00
|
|
|
License: GPL-2.0-or-later
|
Accepting request 982598 from devel:languages:perl:autoupdate
- updated to 20220613
see /usr/share/doc/packages/perl-Perl-Tidy/CHANGES.md
## 2022 06 13
- No significant bugs have been found since the last release but users
of programs which call the Perl::Tidy module should note the first
item below, which changes a default setting. The main change to
existing formatting is the second item below, which adds vertical
alignment to 'use' statements.
- The flag --encode-output-strings, or -eos, is now set 'on' by default.
This has no effect on the use of the 'perltidy' binary script, but could
change the behavior of some programs which use the Perl::Tidy module on
files encoded in UTF-8. If any problems are noticed, an emergency fix
can be made by reverting to the old default by setting -neos. For
an explanation of why this change needs to be made see:
https://github.com/perltidy/perltidy/issues/92
https://github.com/perltidy/perltidy/blob/master/docs/eos_flag.md
- Added vertical alignment for qw quotes and empty parens in 'use'
statements (see issue #git 93). This new alignment is 'on' by default
and will change formatting as shown below. If this is not wanted it can
be turned off with the parameter -vxl='q' (--valign-exclude-list='q').
# old default, or -vxl='q'
use Getopt::Long qw(GetOptions);
use Fcntl qw(O_RDONLY O_WRONLY O_EXCL O_CREAT);
use Symbol qw(gensym);
use Exporter ();
# new default
use Getopt::Long qw(GetOptions);
use Fcntl qw(O_RDONLY O_WRONLY O_EXCL O_CREAT);
use Symbol qw(gensym);
use Exporter ();
- The parameter -kbb (--keep-break-before) now ignores a request to break
before an opening token, such as '('. Likewise, -kba (--keep-break-after)
now ignores a request to break after a closing token, such as ')'. This
change was made to avoid a rare instability discovered in random testing.
- Previously, if a -dsc command was used to delete all side comments,
then any special side comments for controlling non-indenting braces got
deleted too. Now, these control side comments are retained when -dsc is
set unless a -nnib (--nonon-indenting-braces) flag is also set to
deactivate them.
- This version runs about 10 percent faster on large files than the previous
release due to optimizations made with the help of Devel::NYTProf. Much
of the gain came from faster processing of blank tokens and comments.
- This version of perltidy 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.
OBS-URL: https://build.opensuse.org/request/show/982598
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Perl-Tidy?expand=0&rev=70
2022-06-16 14:12:10 +00:00
|
|
|
Summary: Indent and reformat perl scripts
|
Accepting request 816296 from devel:languages:perl:autoupdate
- updated to 20200619
see /usr/share/doc/packages/perl-Perl-Tidy/CHANGES.md
## 2020 06 19
- Added support for Switch::Plain syntax, issue git #31.
- Fixed minor problem where trailing 'unless' clauses were not
getting vertically aligned.
- Added a parameter --logical-padding or -lop to allow logical padding
to be turned off. Requested by git #29. This flag is on by default.
The man pages have examples.
- Added a parameter -kpit=n to control spaces inside of parens following
certain keywords, requested in git#26. This flag is off by default.
- Added fix for git#25, improve vertical alignment for long lists with
varying numbers of items per line.
- calls to the module Perl::Tidy can now capture any output produced
by a debug flag or one of the 'tee' flags through the new 'debugfile' and
'teefile' call parameters. These output streams are rarely used but
they are now treated the same as any 'logfile' stream.
- add option --break-at-old-semicolon-breakpoints', -bos, requested
in RT#131644. This flag will keep lines beginning with a semicolon.
- Added --use-unicode-gcstring to control use of Unicode::GCString for
evaluating character widths of encoded data. The default is
not to use this (--nouse-unicode-gcstring). If this flag is set,
perltidy will look for Unicode::GCString and, if found, will use it
to evaluate character display widths. This can improve displayed
vertical alignment for files with wide characters. It is a nice
feature but it is off by default to avoid conflicting formatting
when there are multiple developers. Perltidy installation does not
require Unicode::GCString, so users wanting to use this feature need
set this flag and also to install Unicode::GCString separately.
- Added --character-encoding=guess or -guess to have perltidy guess
if a file (or other input stream) is encoded as -utf8 or some
other single-byte encoding. This is useful when processing a mixture
of file types, such as utf8 and latin-1.
Please Note: The default encoding has been set to be 'guess'
instead of 'none'. This seems like the best default, since
it allows perltidy work properly with both
utf8 files and older latin-1 files. The guess mode uses Encode::Guess,
which is included in standard perl distributions, and only tries to
guess if a file is utf8 or not, never any other encoding. If the guess is
utf8, and if the file successfully decodes as utf8, then it the encoding
is assumed to be utf8. Otherwise, no encoding is assumed.
If you do not want to use this new default guess mode, or have a
problem with it, you can set --character-encoding=none (the previous
default) or --character-encoding=utf8 (if you deal with utf8 files).
- Specific encodings of input files other than utf8 may now be given, for
example --character-encoding=euc-jp.
- Fix for git#22, Preserve function signature on a single line. An
unwanted line break was being introduced when a closing signature paren
followed a closing do brace.
- Fix RT#132059, the -dac parameter was not working and caused an error exit
- When -utf8 is used, any error output is encoded as utf8
- Fix for git#19, adjust line break around an 'xor'
- Fix for git#18, added warning for missing comma before unknown bare word.
OBS-URL: https://build.opensuse.org/request/show/816296
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Perl-Tidy?expand=0&rev=50
2020-07-01 11:31:53 +00:00
|
|
|
URL: https://metacpan.org/release/%{cpan_name}
|
Accepting request 1110564 from devel:languages:perl:autoupdate
- 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.
OBS-URL: https://build.opensuse.org/request/show/1110564
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Perl-Tidy?expand=0&rev=78
2023-09-12 15:21:26 +00:00
|
|
|
Source0: https://cpan.metacpan.org/authors/id/S/SH/SHANCOCK/%{cpan_name}-%{cpan_version}.tar.gz
|
2015-08-23 14:13:26 +00:00
|
|
|
Source1: cpanspec.yml
|
2010-10-13 23:13:00 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
|
BuildRequires: perl
|
|
|
|
|
BuildRequires: perl-macros
|
Accepting request 1153674 from devel:languages:perl:autoupdate
- updated to 20240202
see /usr/share/doc/packages/perl-Perl-Tidy/CHANGES.md
## 2024 02 02
- Added --valign-signed-numbers, or -vsn. This improves the appearance
of columns of numbers by aligning leading algebraic signs. For example:
# perltidy -vsn
my $xyz_shield = [
[ -0.060, -0.060, 0. ],
[ 0.060, -0.060, 0. ],
[ 0.060, 0.060, 0. ],
[ -0.060, 0.060, 0. ],
[ -0.0925, -0.0925, 0.092 ],
[ 0.0925, -0.0925, 0.092 ],
[ 0.0925, 0.0925, 0.092 ],
[ -0.0925, 0.0925, 0.092 ],
];
# perltidy -nvsn (current DEFAULT)
my $xyz_shield = [
[ -0.060, -0.060, 0. ],
[ 0.060, -0.060, 0. ],
[ 0.060, 0.060, 0. ],
[ -0.060, 0.060, 0. ],
[ -0.0925, -0.0925, 0.092 ],
[ 0.0925, -0.0925, 0.092 ],
[ 0.0925, 0.0925, 0.092 ],
[ -0.0925, 0.0925, 0.092 ],
];
This new option works well but is currently OFF to allow more testing
and fine-tuning. It is expected to be activated in a future release.
- Added --dump-mixed-call-parens (-dmcp ) which will dump a list of
operators which are sometimes followed by parens and sometimes not.
This can be useful for developing a uniform style for selected operators.
Issue git #128. For example
perltidy -dmcp somefile.pl >out.txt
produces lines like this, where the first number is the count of
uses with parens, and the second number is the count without parens.
k:caller:2:1
k:chomp:3:4
k:close:7:4
- Added --want-call-parens=s (-wcp=s) and --nowant-call-parens=s (-nwcp=s)
options which will warn of paren uses which do not match a selected
style. The manual has details. But for example,
perltidy -wcp='&' somefile.pl
will format as normal but warn if any user subs are called without parens.
- Added --dump-unusual-variables (-duv) option to dump a list of
variables with certain properties of interest. For example
perltidy -duv somefile.pl >vars.txt
produces a file with lines which look something like
1778:u: my $input_file
6089:r: my $j: reused - see line 6076
The values on the line which are separated by colons are:
line number - the number of the line of the input file
issue - a single letter indicating the issue, see below
variable name - the name of the variable, preceded by a keyword
note - an optional note referring to another line
The issue is indicated by a letter which may be one of:
r: reused variable name
s: sigil change but reused bareword
p: lexical variable with scope in multiple packages
u: unused variable
This is very useful for locating problem areas and bugs in code.
- Added a related flag --warn-variable-types=string (-wvt=string) option
to warn if certain types of variables are found in a script. The types
are a space-separated string which may include 'r', 's', and 'p' but
not 'u'. For example
perltidy -wvt='r s' somefile.pl
will check for and warn if any variabls of type 'r', or 's' are seen,
but not 'p'. All possible checks may be indicated with a '*' or '1':
perltidy -wvt='*' somefile.pl
The manual has further details.
- All parameters taking integer values are now checked for
out-of-range values before processing starts. When a maximum or
maximum range is exceeded, the new default behavior is to write a
warning message, reset the value to its default setting, and continue.
This default behavior can be changed with the new parameter
--integer-range-check=n, or -irc=n, as follows:
n=0 skip check completely (for stress-testing perltidy only)
n=1 reset bad values to defaults but do not issue a warning
n=2 reset bad values to defaults and issue a warning [DEFAULT]
n=3 stop immediately if any values are out of bounds
The settings n=0 and n=1 are mainly useful for testing purposes.
- The --dump-block-summary (-dbs) option now includes the number of sub
args in the 'type' column. For example, 'sub(9)' indicates a sub
with 9 args. Subs whose arg count cannot easily be determined are
indicated as 'sub(*)'. The count does not include a leading '$self'
or '$class' arg.
- Added flag --space-signature-paren=n, or -ssp=n (issue git #125).
This flag works the same as the existing flag --space-prototype-paren=n
except that it applies to the space before the opening paren of a sub
signature instead of a sub prototype. Previously, there was no control
over this (a space always occurred). For example, given the following
line:
sub circle( $xc, $yc, $rad );
The following results can now be obtained, according to the value of n:
sub circle( $xc, $yc, $rad ); # n=0 [no space]
sub circle( $xc, $yc, $rad ); # n=1 [default; same as input]
sub circle ( $xc, $yc, $rad ); # n=2 [space]
The spacing in previous versions of perltidy corresponded to n=2 (always
a space). The new default value, n=1, will produce a space if and only
if there was a space in the input text.
- The --dump-block-summary option can report an if-elsif-elsif-.. chain
as a single line item with the notation -dbt='elsif3', for example,
where the '3' is an integer which specifies the minimum number of elsif
blocks required for a chain to be reported. The manual has details.
- Fix problem c269, in which the new -ame parameter could incorrectly
emit an else block when two elsif blocks were separated by a hanging
side comment (a very rare situation).
- When braces are detected to be unbalanced, an attempt is made to
localize the error by comparing the indentation at closing braces
with their actual nesting levels. This can be useful for files which
have previously been formatted by perltidy. To illustrate, a test was
made in which the closing brace at line 30644 was commented out in
a file with a total of over 62000 lines. The new error message is
Final nesting depth of '{'s is 1
The most recent un-matched '{' is on line 6858
...
Table of nesting level differences at closing braces.
This might help localize brace errors if the file was previously formatted.
line: (brace level) - (level expected from old indentation)
30643: 0
30645: 1
Previously, the error file only indicated that the error in this case
was somewhere after line 6858, so the new table is very helpful. Closing
brace indentation is checked because it is unambiguous and can be done
very efficiently.
- The -DEBUG option no longer automatically also writes a .LOG file.
Use --show-options if the .LOG file is needed.
- The run time of this version with all new options in use is no greater
than that of the previous version thanks to optimization work.
OBS-URL: https://build.opensuse.org/request/show/1153674
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Perl-Tidy?expand=0&rev=82
2024-03-07 17:25:02 +00:00
|
|
|
Provides: perl(Perl::Tidy) = %{version}
|
|
|
|
|
Provides: perl(Perl::Tidy::Debugger) = %{version}
|
|
|
|
|
Provides: perl(Perl::Tidy::Diagnostics) = %{version}
|
|
|
|
|
Provides: perl(Perl::Tidy::FileWriter) = %{version}
|
|
|
|
|
Provides: perl(Perl::Tidy::Formatter) = %{version}
|
|
|
|
|
Provides: perl(Perl::Tidy::HtmlWriter) = %{version}
|
|
|
|
|
Provides: perl(Perl::Tidy::IOScalar) = %{version}
|
|
|
|
|
Provides: perl(Perl::Tidy::IOScalarArray) = %{version}
|
|
|
|
|
Provides: perl(Perl::Tidy::IndentationItem) = %{version}
|
|
|
|
|
Provides: perl(Perl::Tidy::Logger) = %{version}
|
|
|
|
|
Provides: perl(Perl::Tidy::Tokenizer) = %{version}
|
|
|
|
|
Provides: perl(Perl::Tidy::VerticalAligner) = %{version}
|
|
|
|
|
Provides: perl(Perl::Tidy::VerticalAligner::Alignment) = %{version}
|
|
|
|
|
Provides: perl(Perl::Tidy::VerticalAligner::Line) = %{version}
|
2024-03-08 22:56:28 +00:00
|
|
|
%undefine __perllib_provides
|
2013-07-27 12:44:22 +00:00
|
|
|
%{perl_requires}
|
2010-04-29 14:44:44 +00:00
|
|
|
|
|
|
|
|
%description
|
2010-10-13 23:13:00 +00:00
|
|
|
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.
|
2010-04-29 14:44:44 +00:00
|
|
|
|
2013-07-27 12:44:22 +00:00
|
|
|
For example, the perltidy script is basically just this:
|
|
|
|
|
|
|
|
|
|
use Perl::Tidy;
|
|
|
|
|
Perl::Tidy::perltidy();
|
|
|
|
|
|
|
|
|
|
The call to *perltidy* returns a scalar *$error_flag* which is TRUE if an
|
|
|
|
|
error caused premature termination, and FALSE if the process ran to normal
|
2016-03-09 06:33:32 +00:00
|
|
|
completion. Additional discuss of errors is contained below in the ERROR
|
|
|
|
|
HANDLING section.
|
2013-07-27 12:44:22 +00:00
|
|
|
|
2010-04-29 14:44:44 +00:00
|
|
|
%prep
|
Accepting request 1288028 from devel:languages:perl:autoupdate
- updated to 20250616.0.0 (20250616)
see /usr/share/doc/packages/perl-Perl-Tidy/CHANGES.md
## 2025 06 16
- Added support for the assigning logical xor ^^= operator
- For input parameters which allow a paren type to be selected, the
selection 'f' (function call) now includes functions called with
a direct arrow before the paren, '->('. This was an oversight which
has been corrected.
- A new parameter --break-at-old-comma-types=s, or -boct=s, allows the
parameter --break-at-old-comma-breakpoints (-boc) to be limited to
selected container types. For example, -boc -boct='f(' means break
at old commas but only if they are function call lists.
- A new parameter --cuddled-paren-brace-weld, or -cpbw, has been added to
handle issue git #184. This modifies --cuddled-paren-brace by
preventing a paren and following brace from getting separated in
certain situations. The difference is illustrated here:
# perltidy -cpb alone has no effect for this short snippet:
if ( $Kouter_opening == $Kfirst
&& $has_tight_paren{$type_prev} )
{
$Kref = $Kprev;
}
# perltidy -cpb -cpbw keeps the closing paren next to the opening brace:
if (
$Kouter_opening == $Kfirst
&& $has_tight_paren{$type_prev}
) {
$Kref = $Kprev;
}
- The parameter --maximum-fields-per-table, or -mft, now accepts a string
input which can limit its application to certain containers. For
example, -mft='f(1' means that function call lists should be formatted
with just 1 item per line. It has no effect on other tables. The
manual has further information.
- Add option --break-open-compact-parens=s, discussed in git #78.
This changes the default formatting for lists which would normally
be displayed compactly on two lines. It causes them to be formatted
in the same way as long lists, with line breaks at the opening and
closing parentheses.
- Add option --skip-formatting-except-id=NAME, or -sfei=NAME, discussed
in git #183. This allows formatting to apply only to lines tagged
with #<<< id=NAME, where NAME is a user-defined tag. The special
variation -sfei='-' can be used to run perltidy with full checking
but without any formatting changes.
- A relatively rare problem with the formatting combination -xci and -lp or
-xlp has been fixed. Some lines had more leading spaces that intended.
- New option -m added to --dump-mismatched-returns and
--warn-mismatched-returns. This checks for multiple array
return sizes. A warning occurs when a sub has multiple returns
of finite lists with different counts greater than 1, and
not all of them are matched with calls.
- Improved support for Object::Pad, see git #182.
- A limitation on the treatment of lexical subs has been fixed. Previously,
a lexical sub with the same name as a quote operator would produce a warning,
and might cause a tokenization error.
- Here targets in quotes are now located and handled correctly.
OBS-URL: https://build.opensuse.org/request/show/1288028
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Perl-Tidy?expand=0&rev=96
2025-06-24 07:16:01 +00:00
|
|
|
%autosetup -n %{cpan_name}-%{cpan_version} -p1
|
Accepting request 1070500 from devel:languages:perl:autoupdate
- updated to 20230309
see /usr/share/doc/packages/perl-Perl-Tidy/CHANGES.md
## 2023 03 09
- No significant bugs have been found since the last release to CPAN.
Several minor issues have been fixed, and some new parameters have been
added, as follows:
- Added parameter --one-line-block-exclusion-list=s, or -olbxl=s, where
s is a list of block types which should not automatically be turned
into one-line blocks. This implements the issue raised in PR #111.
The list s may include any of the words 'sort map grep eval', or
it may be '*' to indicate all of these. So for example to prevent
multi-line 'eval' blocks from becoming one-line blocks, the command
would be -olbxl='eval'.
- For the -b (--backup-and-modify-in-place) option, the file timestamps
are changing (git #113, rt#145999). First, if there are no formatting
changes to an input file, it will keep its original modification time.
Second, any backup file will keep its original modification time. This
was previously true for --backup-method=move but not for the default
--backup-method=copy. The purpose of these changes is to avoid
triggering Makefile operations when there are no actual file changes.
If this causes a problem please open an issue for discussion on github.
- A change was made to the way line breaks are made at the '.'
operator when the user sets -wba='.' to requests breaks after a '.'
( this setting is not recommended because it can be hard to read ).
The goal of the change is to make switching from breaks before '.'s
to breaks after '.'s just move the dots from the end of
lines to the beginning of lines. For example:
# default and recommended (--want-break-before='.'):
$output_rules .=
( 'class'
. $dir
. '.stamp: $('
. $dir
. '_JAVA)' . "\n" . "\t"
. '$(CLASSPATH_ENV) $(JAVAC) -d $(JAVAROOT) '
. '$(JAVACFLAGS) $?' . "\n" . "\t"
. 'echo timestamp > class'
. $dir
. '.stamp'
. "\n" );
# perltidy --want-break-after='.'
$output_rules .=
( 'class' .
$dir .
'.stamp: $(' .
$dir .
'_JAVA)' . "\n" . "\t" .
'$(CLASSPATH_ENV) $(JAVAC) -d $(JAVAROOT) ' .
'$(JAVACFLAGS) $?' . "\n" . "\t" .
'echo timestamp > class' .
$dir .
'.stamp' .
"\n" );
For existing code formatted with -wba='.', this may cause some
changes in the formatting of code with long concatenation chains.
- Added option --use-feature=class, or -uf=class, for issue rt #145706.
This adds keywords 'class', 'method', 'field', and 'ADJUST' in support of
this feature which is being tested for future inclusion in Perl.
An effort has been made to avoid conflicts with past uses of these
words, especially 'method' and 'class'. The default setting
is --use-feature=class. If this causes a conflict, this option can
be turned off by entering -uf=' '.
In other words, perltidy should work for both old and new uses of
these keywords with the default settings, but this flag is available
if a conflict arises.
- Added option -bfvt=n, or --brace-follower-vertical-tightness=n,
for part of issue git #110. For n=2, this option looks for lines
which would otherwise be, by default,
}
or ..
and joins them into a single line
} or ..
where the or can be one of a number of logical operators or if unless.
The default is not to do this and can be indicated with n=1.
- Added option -cpb, or --cuddled-paren-brace, for issue git #110.
This option will cause perltidy to join two lines which
otherwise would be, by default,
)
{
into a single line
) {
- Some minor changes to existing formatted output may occur as a result
of fixing minor formatting issues with edge cases. This is especially
true for code which uses the -lp or -xlp styles.
- Added option -dbs, or --dump-block-summary, to dump summary
information about code blocks in a file to standard output.
The basic command is:
perltidy -dbs somefile.pl >blocks.csv
Instead of formatting ``somefile.pl``, this dumps the following
comma-separated items describing its blocks to the standard output:
filename - the name of the file
line - the line number of the opening brace of this block
line_count - the number of lines between opening and closing braces
code_lines - the number of lines excluding blanks, comments, and pod
type - the block type (sub, for, foreach, ...)
name - the block name if applicable (sub name, label, asub name)
depth - the nesting depth of the opening block brace
max_change - the change in depth to the most deeply nested code block
block_count - the total number of code blocks nested in this block
mccabe_count - the McCabe complexity measure of this code block
This can be useful for code restructuring. The man page for perltidy
has more information and describes controls for selecting block types.
- This version was stress-tested for over 100 cpu hours with random
input parameters. No failures to converge, internal fault checks,
undefined variable references or other irregularities were seen.
- This version runs a few percent faster than the previous release on
large files due to optimizations made with the help of Devel::NYTProf.
OBS-URL: https://build.opensuse.org/request/show/1070500
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Perl-Tidy?expand=0&rev=74
2023-03-10 10:45:09 +00:00
|
|
|
|
Accepting request 1097588 from devel:languages:perl:autoupdate
- updated to 20230701
see /usr/share/doc/packages/perl-Perl-Tidy/CHANGES.md
## 2023 07 01
- Issue git #121. Added parameters -xbt, or --extended-block-tightness,
and -xbtl=s, or --extended-block-tightness-list=s, to allow
certain small code blocks to have internal spacing controlled by
-bbt=n rather than -bt=n. The man pages have details.
- Issue git #118. A warning will be issued if a duplicate format-skipping
starting marker is seen within a format-skipping section. The same
applies to duplicate code-skipping starting markers within code-skipping
sections.
- Issue git #116. A new flag --valign-if-unless, -viu, was added to
allow postfix 'unless' terms to align with postfix 'if' terms. The
default remains not to do this.
- Fixed git #115. In the two most recent CPAN releases, when the
Perl::Tidy module was called with the source pointing to a file,
but no destination specified, the output went to the standard
output instead of to a file with extension ``.tdy``, as it should
have. This has been fixed.
- Fixed git #110, add missing documentation for new options
-cpb and -bfvt=n. These work in version 20230309 but the pod
documentation was missing and has been added.
- Fixed an undefined reference message when running with
--dump-block-summary on a file without any subs or other
selected block types.
- Add parameter -ipc, or --ignore-perlcritic-comments. Perltidy, by
default, will look for side comments beginning with ``## no critic`` and
ignore their lengths when making line break decisions, even if the user
has not set ``-iscl``. The reason is that an unwanted line break can
make these special comments ineffective in controlling ``perlcritic``.
The parameter -ipc can be set if, for some reason, this is not wanted.
- Some minor issues with continuation indentation have been fixed.
Most scripts will remain unchanged. The main change is that block
comments which occur just before a closing brace, bracket or paren
now have an indentation which is independent of the existance of
an optional comma or semicolon. Previously, adding or deleting
an optional trailing comma could cause their indentation to jump.
Also, indentation of comments within ternary statements has been
improved. For additonal details see:
https://github.com/perltidy/perltidy/blob/master/docs/ci_update.md
- 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.
- This version runs several percent faster than the previous release
on large files.
OBS-URL: https://build.opensuse.org/request/show/1097588
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Perl-Tidy?expand=0&rev=76
2023-07-11 13:14:59 +00:00
|
|
|
find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path "*/script/*" ! -path "*/scripts/*" ! -name "configure" -print0 | xargs -0 chmod 644
|
2010-04-29 14:44:44 +00:00
|
|
|
|
|
|
|
|
%build
|
2018-12-06 16:17:10 +00:00
|
|
|
perl Makefile.PL INSTALLDIRS=vendor
|
Accepting request 862581 from devel:languages:perl:autoupdate
- updated to 20210111
see /usr/share/doc/packages/perl-Perl-Tidy/CHANGES.md
## 2021 01 11
- Fixed issue git #49, -se breaks warnings exit status behavior.
The exit status flag was not always being set when the -se flag was set.
- Some improvements have been made in the method for aligning side comments.
One of the problems that was fixed is that there was a tendency for side comment
placement to drift to the right in long scripts. Programs with side comments
may have a few changes.
- Some improvements have been made in formatting qw quoted lists. This
fixes issue git #51, in which closing qw pattern delimiters not always
following the settings specified by the --closing-token-indentation=n settings.
Now qw closing delimiters ')', '}' and ']' follow these flags, and the
delimiter '>' follows the flag for ')'. Other qw pattern delimiters remain
indented as the are now. This change will cause some small formatting changes
in some existing programs.
- Another change involving qw lists is that they get full indentation,
rather than just continuation indentation, if
(1) the closing delimiter is one of } ) ] > and is on a separate line,
(2) the opening delimiter (i.e. 'qw{' ) is also on a separate line, and
(3) the -xci flag (--extended-continuation-indentation) is set.
This improves formatting when qw lists are contained in other lists. For example,
# OLD: perltidy
foreach $color (
qw(
AntiqueWhite3 Bisque1 Bisque2 Bisque3 Bisque4
SlateBlue3 RoyalBlue1 SteelBlue2 DeepSkyBlue3
),
qw(
LightBlue1 DarkSlateGray1 Aquamarine2 DarkSeaGreen2
SeaGreen1 Yellow1 IndianRed1 IndianRed2 Tan1 Tan4
)
)
# NEW, perltidy -xci
foreach $color (
qw(
AntiqueWhite3 Bisque1 Bisque2 Bisque3 Bisque4
SlateBlue3 RoyalBlue1 SteelBlue2 DeepSkyBlue3
),
qw(
LightBlue1 DarkSlateGray1 Aquamarine2 DarkSeaGreen2
SeaGreen1 Yellow1 IndianRed1 IndianRed2 Tan1 Tan4
)
)
- Some minor improvements have been made to the rules for formatting
some edge vertical alignment cases, usually involving two dissimilar lines.
- A more complete list of updates is at
https://github.com/perltidy/perltidy/blob/master/local-docs/BugLog.pod
OBS-URL: https://build.opensuse.org/request/show/862581
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Perl-Tidy?expand=0&rev=62
2021-01-12 12:05:10 +00:00
|
|
|
%make_build
|
2010-04-29 14:44:44 +00:00
|
|
|
|
|
|
|
|
%check
|
2018-12-06 16:17:10 +00:00
|
|
|
make test
|
2010-04-29 14:44:44 +00:00
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%perl_make_install
|
2013-07-27 12:44:22 +00:00
|
|
|
%perl_process_packlist
|
2010-04-29 14:44:44 +00:00
|
|
|
%perl_gen_filelist
|
|
|
|
|
|
|
|
|
|
%files -f %{name}.files
|
2020-08-24 16:02:50 +00:00
|
|
|
%doc BUGS.md CHANGES.md docs examples pm2pl README.md
|
2017-05-25 14:59:16 +00:00
|
|
|
%license COPYING
|
2010-04-29 14:44:44 +00:00
|
|
|
|
|
|
|
|
%changelog
|