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 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
|
|
|
# Copyright (c) 2023 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
|
2023-09-28 09:25:56 +00:00
|
|
|
Version: 20230912.0.0
|
2013-07-27 12:44:22 +00:00
|
|
|
Release: 0
|
2023-09-28 09:25:56 +00:00
|
|
|
%define cpan_version 20230912
|
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
|
2023-09-28 09:25:56 +00:00
|
|
|
Provides: perl(Perl::Tidy) = 20230912.0.0
|
|
|
|
|
Provides: perl(Perl::Tidy::Debugger) = 20230912.0.0
|
|
|
|
|
Provides: perl(Perl::Tidy::Diagnostics) = 20230912.0.0
|
|
|
|
|
Provides: perl(Perl::Tidy::FileWriter) = 20230912.0.0
|
|
|
|
|
Provides: perl(Perl::Tidy::Formatter) = 20230912.0.0
|
|
|
|
|
Provides: perl(Perl::Tidy::HtmlWriter) = 20230912.0.0
|
|
|
|
|
Provides: perl(Perl::Tidy::IOScalar) = 20230912.0.0
|
|
|
|
|
Provides: perl(Perl::Tidy::IOScalarArray) = 20230912.0.0
|
|
|
|
|
Provides: perl(Perl::Tidy::IndentationItem) = 20230912.0.0
|
|
|
|
|
Provides: perl(Perl::Tidy::Logger) = 20230912.0.0
|
|
|
|
|
Provides: perl(Perl::Tidy::Tokenizer) = 20230912.0.0
|
|
|
|
|
Provides: perl(Perl::Tidy::VerticalAligner) = 20230912.0.0
|
|
|
|
|
Provides: perl(Perl::Tidy::VerticalAligner::Alignment) = 20230912.0.0
|
|
|
|
|
Provides: perl(Perl::Tidy::VerticalAligner::Line) = 20230912.0.0
|
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
|
|
|
%define __perllib_provides /bin/true
|
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 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
|
|
|
%autosetup -n %{cpan_name}-%{cpan_version}
|
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
|