# Perltidy Change Log
-## 2019 06 01.01
+## 2019 09 15
- implement issue RT#130425: check mode. A new flag '--assert-tidy'
will cause an error message if the output script is not identical to
for "use lib".
- fixed issue RT#130304: standard error output should include filename.
- When perltidy error messages are directed to the standard error output with
- -se or --standard-error-output, the message lines now have a prefix with
- 'filename:' for clarification when multiple files are processed. If an
- input filename is not known, for example when input is from the standard
- input or a data structure, then displayed filename is 'perltidy'.
+ When perltidy error messages are directed to the standard error output
+ with -se or --standard-error-output, the message lines now have a prefix
+ 'filename:' for clarification in case multiple files
+ are processed, where 'filename' is the name of the input file. If
+ input is from the standard input the displayed filename is '<stdin>',
+ and if it is from a data structure then displayed filename
+ is '<source_stream>'.
- fixed issue RT#130297; the perltidy script now exits with a nonzero exit
status if it wrote to the standard error output. Prevously only fatal
flag now has these values:
0 = no errors
- 1 = fatal error
- 2 = non-fatal error
+ 1 = perltidy could not run to completion due to errors
+ 2 = perltidy ran to completion with error messages
- added warning message for RT#130008, which warns of conflicting input
parameters -iob and -bom or -boc.
my @addunix = map { File::Spec::Unix->catfile( @ROOT, @$_ ) } ['b'];
Formerly, any space was removed. Now it is optional, and the output will
- follow the input.
+ follow the input.
- fixed issue git#13, needless trailing whitespace in error message
}
# Exit codes returned by perltidy:
-# 0 - successful run without errors
-# 1 - run terminated with a fatal error
-# 2 - successful run but with non-fatal warning messages
+# 0 = no errors
+# 1 = perltidy could not run to completion due to errors
+# 2 = perltidy ran to completion with error messages
exit Perl::Tidy::perltidy( argv => $arg_string );
__END__
This flag asserts that the input and output code streams are identical, or in
other words that the input code is already 'tidy' according to the formatting
parameters. If this is not the case, an error message noting this is produced.
+This error message will cause the process to return a non-zero exit code.
The test for this is made by comparing an MD5 hash value for the input and
output code streams. This flag has no other effect on the functioning of
perltidy. This might be useful for certain code maintenance operations.
=back
+=head1 ERROR HANDLING
+
+An exit value of 0, 1, or 2 is returned by perltidy to indicate the status of the result.
+
+A exit value of 0 indicates that perltidy ran to completion with no error messages.
+
+An exit value of 1 indicates that the process had to be terminated early due to
+errors in the input parameters. This can happen for example if a parameter is
+misspelled or given an invalid value. Error messages in the standard
+error output will indicate the cause of any problem.
+
+An exit value of 2 indicates that perltidy ran to completion but there there
+are warning messages in the standard error output related to parameter errors or
+conflicts and/or warning messages in the perltidy error file(s) relating to
+possible syntax errors in the source code being tidied.
+
=head1 SEE ALSO
perlstyle(1), Perl::Tidy(3)
=head1 VERSION
-This man page documents perltidy version 20190601.01
+This man page documents perltidy version 20190915
=head1 BUG REPORTS
<h1>Perltidy Change Log</h1>
+<h2>2019 09 15</h2>
+
+<pre><code>- implement issue RT#130425: check mode. A new flag '--assert-tidy'
+ will cause an error message if the output script is not identical to
+ the input script. For completeness, the opposite flag '--assert-untidy'
+ has also been added.
+
+- iteration speedup for unchanged code. Previously, when iterations were
+ requested, at least two formatting passes were made. Now just a single pass
+ is made if the formatted code is identical to the input code.
+
+- fixed issue RT#130344: false warning "operator in print statement"
+ for "use lib".
+
+- fixed issue RT#130304: standard error output should include filename.
+ When perltidy error messages are directed to the standard error output
+ with -se or --standard-error-output, the message lines now have a prefix
+ 'filename:' for clarification in case multiple files
+ are processed, where 'filename' is the name of the input file. If
+ input is from the standard input the displayed filename is '<stdin>',
+ and if it is from a data structure then displayed filename
+ is '<source_stream>'.
+
+- fixed issue RT#130297; the perltidy script now exits with a nonzero exit
+ status if it wrote to the standard error output. Prevously only fatal
+ run errors produced a non-zero exit flag. Now, even non-fatal messages
+ requested with the -w flag will cause a non-zero exit flag. The exit
+ flag now has these values:
+
+ 0 = no errors
+ 1 = perltidy could not run to completion due to errors
+ 2 = perltidy ran to completion with error messages
+
+- added warning message for RT#130008, which warns of conflicting input
+ parameters -iob and -bom or -boc.
+
+- fixed RT#129850; concerning a space between a closing block brace and
+ opening bracket or brace, as occurs before the '[' in this line:
+
+ my @addunix = map { File::Spec::Unix->catfile( @ROOT, @$_ ) } ['b'];
+
+ Formerly, any space was removed. Now it is optional, and the output will
+ follow the input.
+
+- fixed issue git#13, needless trailing whitespace in error message
+
+- fixed issue git#9: if the -ce (--cuddled-else) flag is used,
+ do not try to form new one line blocks for a block type
+ specified with -cbl, particularly map, sort, grep
+
+- some improved vertical alignments
+</code></pre>
+
<h2>2019 06 01</h2>
<pre><code>- rt #128477: Prevent inconsistent owner/group and setuid/setgid bits.
- Fixed RT #107832 and #106492, lack of vertical alignment of two lines
when -boc flag (break at old commas) is set. This bug was
- inadvertently introduced in previous bug fix RT #98902.
+ inadvertently introduced in previous bug fix RT #98902.
- Some common extensions to Perl syntax are handled better.
In particular, the following snippet is now foratted cleanly:
<h1 id="ERROR-HANDLING">ERROR HANDLING</h1>
-<p>Perltidy will return with an error flag indicating if the process had to be terminated early due to errors in the input parameters. This can happen for example if a parameter is misspelled or given an invalid value. The calling program should check this flag because if it is set the destination stream will be empty or incomplete and should be ignored. Error messages in the <b>stderr</b> stream will indicate the cause of any problem.</p>
+<p>An exit value of 0, 1, or 2 is returned by perltidy to indicate the status of the result.</p>
-<p>If the error flag is not set then perltidy ran to completion. However there may still be warning messages in the <b>stderr</b> stream related to control parameters, and there may be warning messages in the <b>errorfile</b> stream relating to possible syntax errors in the source code being tidied.</p>
+<p>A exit value of 0 indicates that perltidy ran to completion with no error messages.</p>
+
+<p>An exit value of 1 indicates that the process had to be terminated early due to errors in the input parameters. This can happen for example if a parameter is misspelled or given an invalid value. The calling program should check for this flag because if it is set the destination stream will be empty or incomplete and should be ignored. Error messages in the <b>stderr</b> stream will indicate the cause of any problem.</p>
+
+<p>An exit value of 2 indicates that perltidy ran to completion but there there are warning messages in the <b>stderr</b> stream related to parameter errors or conflicts and/or warning messages in the <b>errorfile</b> stream relating to possible syntax errors in the source code being tidied.</p>
<p>In the event of a catastrophic error for which recovery is not possible <b>perltidy</b> terminates by making calls to <b>croak</b> or <b>confess</b> to help the programmer localize the problem. These should normally only occur during program development.</p>
<h1 id="VERSION">VERSION</h1>
-<p>This man page documents Perl::Tidy version 20190601</p>
+<p>This man page documents Perl::Tidy version 20190915</p>
<h1 id="LICENSE">LICENSE</h1>
<li><a href="#SWITCHES-WHICH-MAY-BE-NEGATED">SWITCHES WHICH MAY BE NEGATED</a></li>
<li><a href="#LIMITATIONS">LIMITATIONS</a></li>
<li><a href="#FILES">FILES</a></li>
+ <li><a href="#ERROR-HANDLING">ERROR HANDLING</a></li>
<li><a href="#SEE-ALSO">SEE ALSO</a></li>
<li><a href="#VERSION">VERSION</a></li>
<li><a href="#BUG-REPORTS">BUG REPORTS</a></li>
<p>Force perltidy to process binary files. To avoid producing excessive error messages, perltidy skips files identified by the system as non-text. However, valid perl scripts containing binary data may sometimes be identified as non-text, and this flag forces perltidy to process them.</p>
+</dd>
+<dt id="ast---assert-tidy"><b>-ast</b>, <b>--assert-tidy</b></dt>
+<dd>
+
+<p>This flag asserts that the input and output code streams are identical, or in other words that the input code is already 'tidy' according to the formatting parameters. If this is not the case, an error message noting this is produced. This error message will cause the process to return a non-zero exit code. The test for this is made by comparing an MD5 hash value for the input and output code streams. This flag has no other effect on the functioning of perltidy. This might be useful for certain code maintenance operations.</p>
+
+</dd>
+<dt id="asu---assert-untidy"><b>-asu</b>, <b>--assert-untidy</b></dt>
+<dd>
+
+<p>This flag asserts that the input and output code streams are different, or in other words that the input code is 'untidy' according to the formatting parameters. If this is not the case, an error message noting this is produced. This flag has no other effect on the functioning of perltidy.</p>
+
</dd>
</dl>
</dd>
</dl>
+<h1 id="ERROR-HANDLING">ERROR HANDLING</h1>
+
+<p>An exit value of 0, 1, or 2 is returned by perltidy to indicate the status of the result.</p>
+
+<p>A exit value of 0 indicates that perltidy ran to completion with no error messages.</p>
+
+<p>An exit value of 1 indicates that the process had to be terminated early due to errors in the input parameters. This can happen for example if a parameter is misspelled or given an invalid value. Error messages in the standard error output will indicate the cause of any problem.</p>
+
+<p>An exit value of 2 indicates that perltidy ran to completion but there there are warning messages in the standard error output related to parameter errors or conflicts and/or warning messages in the perltidy error file(s) relating to possible syntax errors in the source code being tidied.</p>
+
<h1 id="SEE-ALSO">SEE ALSO</h1>
<p>perlstyle(1), Perl::Tidy(3)</p>
<h1 id="VERSION">VERSION</h1>
-<p>This man page documents perltidy version 20190601</p>
+<p>This man page documents perltidy version 20190915</p>
<h1 id="BUG-REPORTS">BUG REPORTS</h1>
# Release version must be bumped, and it is probably past time for a
# release anyway.
- $VERSION = '20190601.01';
+ $VERSION = '20190915';
}
sub streamhandle {
# standard error output, even non-fatal warning messages, otherwise return
# false.
- # To allow the caller to determine the error severity, these exit codes are
- # returned:
- # 0 - successful run without errors
- # 1 - run terminated with a fatal error
- # 2 - successful run but with non-fatal warning messages
+ # These exit codes are returned:
+ # 0 = perltidy ran to completion with no errors
+ # 1 = perltidy could not run to completion due to errors
+ # 2 = perltidy ran to completion with error messages
# Note that if perltidy is run with multiple files, any single file with
# errors or warnings will write a line like
=head1 ERROR HANDLING
-Perltidy will return with an error flag indicating if the process had to be
-terminated early due to errors in the input parameters. This can happen for
-example if a parameter is misspelled or given an invalid value. The calling
-program should check this flag because if it is set the destination stream will
-be empty or incomplete and should be ignored. Error messages in the B<stderr>
-stream will indicate the cause of any problem.
-
-If the error flag is not set then perltidy ran to completion. However there
-may still be warning messages in the B<stderr> stream related to control
-parameters, and there may be warning messages in the B<errorfile> stream
-relating to possible syntax errors in the source code being tidied.
+An exit value of 0, 1, or 2 is returned by perltidy to indicate the status of the result.
+
+A exit value of 0 indicates that perltidy ran to completion with no error messages.
+
+An exit value of 1 indicates that the process had to be terminated early due to
+errors in the input parameters. This can happen for example if a parameter is
+misspelled or given an invalid value. The calling program should check for
+this flag because if it is set the destination stream will be empty or
+incomplete and should be ignored. Error messages in the B<stderr> stream will
+indicate the cause of any problem.
+
+An exit value of 2 indicates that perltidy ran to completion but there there
+are warning messages in the B<stderr> stream related to parameter errors or
+conflicts and/or warning messages in the B<errorfile> stream relating to
+possible syntax errors in the source code being tidied.
In the event of a catastrophic error for which recovery is not possible
B<perltidy> terminates by making calls to B<croak> or B<confess> to help the
=head1 VERSION
-This man page documents Perl::Tidy version 20190601.01
+This man page documents Perl::Tidy version 20190915
=head1 LICENSE
package Perl::Tidy::Debugger;
use strict;
use warnings;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
sub new {
package Perl::Tidy::DevNull;
use strict;
use warnings;
-our $VERSION = '20190601.01';
-sub new { my $self = shift; return bless {}, $self }
+our $VERSION = '20190915';
+sub new { my $self = shift; return bless {}, $self }
sub print { return }
sub close { return }
package Perl::Tidy::Diagnostics;
use strict;
use warnings;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
sub new {
package Perl::Tidy::FileWriter;
use strict;
use warnings;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
# Maximum number of little messages; probably need not be changed.
my $MAX_NAG_MESSAGES = 6;
use strict;
use warnings;
use Carp;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
# The Tokenizer will be loaded with the Formatter
##use Perl::Tidy::Tokenizer; # for is_keyword()
$gnu_position_predictor = 0; # where the current token is predicted to be
$max_gnu_stack_index = 0;
$max_gnu_item_index = -1;
- $gnu_stack[0] = new_lp_indentation_item( 0, -1, -1, 0, 0 );
- @gnu_item_list = ();
- $last_output_indentation = 0;
- $last_indentation_written = 0;
- $last_unadjusted_indentation = 0;
- $last_leading_token = "";
+ $gnu_stack[0] = new_lp_indentation_item( 0, -1, -1, 0, 0 );
+ @gnu_item_list = ();
+ $last_output_indentation = 0;
+ $last_indentation_written = 0;
+ $last_unadjusted_indentation = 0;
+ $last_leading_token = "";
$last_output_short_opening_token = 0;
$saw_VERSION_in_this_file = !$rOpts->{'pass-version-line'};
# out of __END__ and __DATA__ sections, because
# the user may be using this section for any purpose whatsoever
if ( $rOpts->{'delete-pod'} ) { $skip_line = 1; }
- if ( $rOpts->{'tee-pod'} ) { $tee_line = 1; }
+ if ( $rOpts->{'tee-pod'} ) { $tee_line = 1; }
if ( $rOpts->{'trim-pod'} ) { $input_line =~ s/\s+$// }
if ( !$skip_line
&& !$in_format_skipping_section
$binary_ws_rules{'t'}{'L'} = WS_NO;
$binary_ws_rules{'t'}{'{'} = WS_NO;
$binary_ws_rules{'}'}{'L'} = WS_NO;
- $binary_ws_rules{'}'}{'{'} = WS_OPTIONAL; # RT#129850; was WS_NO
+ $binary_ws_rules{'}'}{'{'} = WS_OPTIONAL; # RT#129850; was WS_NO
$binary_ws_rules{'$'}{'L'} = WS_NO;
$binary_ws_rules{'$'}{'{'} = WS_NO;
$binary_ws_rules{'@'}{'L'} = WS_NO;
);
}
- # Note: there are additional parameters that can be made inactive by
- # -iob, but they are on by default so we would generate excessive
- # warnings if we noted them. They are:
+ # Note: there are additional parameters that can be made inactive by
+ # -iob, but they are on by default so we would generate excessive
+ # warnings if we noted them. They are:
# $rOpts->{'break-at-old-keyword-breakpoints'}
# $rOpts->{'break-at-old-logical-breakpoints'}
# $rOpts->{'break-at-old-ternary-breakpoints'}
$rcuddled_block_types->{$start}->{$word} =
1; #"$string_count.$word_count";
- # git#9: Remove this word from the list of desired one-line
- # blocks
- $want_one_line_block{$word} = 0;
+ # git#9: Remove this word from the list of desired one-line
+ # blocks
+ $want_one_line_block{$word} = 0;
}
}
return;
my $ibeg = $ri_first->[$n];
my $iend = $ri_last->[$n];
- delete_needless_alignments($ibeg, $iend );
+ delete_needless_alignments( $ibeg, $iend );
my ( $rtokens, $rfields, $rpatterns ) =
make_alignment_patterns( $ibeg, $iend );
# map certain operators to the same class for pattern matching
%operator_map = (
- '!~' => '=~',
- '+=' => '+=',
- '-=' => '+=',
- '*=' => '+=',
- '/=' => '+=',
- );
+ '!~' => '=~',
+ '+=' => '+=',
+ '-=' => '+=',
+ '*=' => '+=',
+ '/=' => '+=',
+ );
}
sub delete_needless_alignments {
my ( $ibeg, $iend ) = @_;
- # Remove unwanted alignments. This routine is a place to remove alignments
- # which might cause problems at later stages. There are currently
- # two types of fixes:
+ # Remove unwanted alignments. This routine is a place to remove alignments
+ # which might cause problems at later stages. There are currently
+ # two types of fixes:
- # 1. Remove excess parens
- # 2. Remove alignments within 'elsif' conditions
+ # 1. Remove excess parens
+ # 2. Remove alignments within 'elsif' conditions
- # Patch #1: Excess alignment of parens can prevent other good
- # alignments. For example, note the parens in the first two rows of
- # the following snippet. They would normally get marked for alignment
- # and aligned as follows:
+ # Patch #1: Excess alignment of parens can prevent other good
+ # alignments. For example, note the parens in the first two rows of
+ # the following snippet. They would normally get marked for alignment
+ # and aligned as follows:
# my $w = $columns * $cell_w + ( $columns + 1 ) * $border;
# my $h = $rows * $cell_h + ( $rows + 1 ) * $border;
# the exception that we always keep alignment of the first opening
# paren on a line (for things like 'if' and 'elsif' statements).
- # Setup needed constants
- my $i_good_paren = -1;
- my $imin_match = $iend + 1;
+ # Setup needed constants
+ my $i_good_paren = -1;
+ my $imin_match = $iend + 1;
my $i_elsif_close = $ibeg - 1;
my $i_elsif_open = $iend + 1;
if ( $iend > $ibeg ) {
if ( $types_to_go[$ibeg] eq 'k' ) {
- # Paren patch: mark a location of a paren we should keep, such
- # as one following something like a leading 'if', 'elsif',..
+ # Paren patch: mark a location of a paren we should keep, such
+ # as one following something like a leading 'if', 'elsif',..
$i_good_paren = $ibeg + 1;
if ( $types_to_go[$i_good_paren] eq 'b' ) {
$i_good_paren++;
}
- # 'elsif' patch: remember the range of the parens of an elsif,
- # and do not make alignments within them because this can cause
- # loss of padding and overall brace alignment in the vertical
- # aligner.
+ # 'elsif' patch: remember the range of the parens of an elsif,
+ # and do not make alignments within them because this can cause
+ # loss of padding and overall brace alignment in the vertical
+ # aligner.
if ( $tokens_to_go[$ibeg] eq 'elsif'
&& $i_good_paren < $iend
&& $tokens_to_go[$i_good_paren] eq '(' )
}
}
- # Loop to make the fixes on this line
+ # Loop to make the fixes on this line
my @imatch_list;
for my $i ( $ibeg .. $iend ) {
if ( $matching_token_to_go[$i] ne '' ) {
- # Patch #2: undo alignment within elsif parens
+ # Patch #2: undo alignment within elsif parens
if ( $i > $i_elsif_open && $i < $i_elsif_close ) {
$matching_token_to_go[$i] = '';
next;
package Perl::Tidy::HtmlWriter;
use strict;
use warnings;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
use File::Basename;
use strict;
use warnings;
use Carp;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
sub new {
my ( $package, $rscalar, $mode ) = @_;
use strict;
use warnings;
use Carp;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
sub new {
my ( $package, $rarray, $mode ) = @_;
package Perl::Tidy::IndentationItem;
use strict;
use warnings;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
sub new {
package Perl::Tidy::LineBuffer;
use strict;
use warnings;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
sub new {
package Perl::Tidy::LineSink;
use strict;
use warnings;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
sub new {
package Perl::Tidy::LineSource;
use strict;
use warnings;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
sub new {
package Perl::Tidy::Logger;
use strict;
use warnings;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
sub new {
package Perl::Tidy::Tokenizer;
use strict;
use warnings;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
use Perl::Tidy::LineBuffer;
elsif (
( $next_nonblank_token eq ':' )
&& ( $rtokens->[ $i_next + 1 ] ne ':' )
- && ( $i_next <= $max_token_index ) # colon on same line
+ && ( $i_next <= $max_token_index ) # colon on same line
&& label_ok()
)
{
else {
if ( $tok =~ /^([x\/\+\-\*\%\&\.\?\<]|\>\>)$/ ) {
- # Do not complain in 'use' statements, which have special syntax.
- # For example, from RT#130344:
- # use lib $FindBin::Bin . '/lib';
- if ($statement_type ne 'use') {
+ # Do not complain in 'use' statements, which have special syntax.
+ # For example, from RT#130344:
+ # use lib $FindBin::Bin . '/lib';
+ if ( $statement_type ne 'use' ) {
complain("operator in print statement not recommended\n");
- }
+ }
$op_expected = OPERATOR;
}
}
package Perl::Tidy::VerticalAligner;
use strict;
use warnings;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
use Perl::Tidy::VerticalAligner::Alignment;
use Perl::Tidy::VerticalAligner::Line;
# This is a preliminary step in vertical alignment in which we remove as
# many obviously un-needed alignment tokens as possible. This will prevent
- # them from interfering with the final alignment.
+ # them from interfering with the final alignment.
return unless @{$rlines};
my $has_terminal_match = $rlines->[-1]->get_j_terminal_match();
my @i_equals;
my @min_levels;
- my $jmax = @{$rnew_lines}-1;
+ my $jmax = @{$rnew_lines} - 1;
my %is_good_tok;
my $i_eq;
my $lev_min;
foreach my $tok ( @{$rtokens} ) {
- my $lev=0;
- my $raw_tok="";
- my $desc="";
- if ($tok =~ /^(\D+)(\d+)(.*)/) { $raw_tok=$1; $lev = $2; $desc=$3}
- if (!defined($lev_min) || $lev < $lev_min) {$lev_min=$lev}
+ my $lev = 0;
+ my $raw_tok = "";
+ my $desc = "";
+ if ( $tok =~ /^(\D+)(\d+)(.*)/ ) {
+ $raw_tok = $1;
+ $lev = $2;
+ $desc = $3;
+ }
+ if ( !defined($lev_min) || $lev < $lev_min ) { $lev_min = $lev }
$rhash->{$tok} = [ $i, undef, undef, $lev ];
# remember the first equals at line level
- if ( !defined($i_eq) && $raw_tok eq '=') {
+ if ( !defined($i_eq) && $raw_tok eq '=' ) {
if ( $lev eq $group_level ) { $i_eq = $i }
}
$i++;
}
push @{$rline_hashes}, $rhash;
- push @i_equals, $i_eq;
+ push @i_equals, $i_eq;
push @min_levels, $lev_min;
}
my $rtok_hash = {};
my $nr = 0;
for ( my $jl = 0 ; $jl < $jmax ; $jl++ ) {
- my $nl = $nr;
- $nr = 0;
+ my $nl = $nr;
+ $nr = 0;
my $jr = $jl + 1;
my $rhash_l = $rline_hashes->[$jl];
my $rhash_r = $rline_hashes->[$jr];
- my $count = 0; # UNUSED NOW?
+ my $count = 0; # UNUSED NOW?
my $ntoks = 0;
foreach my $tok ( keys %{$rhash_l} ) {
$ntoks++;
$rhash_r->{$tok}->[1] = $il;
if ( $tok ne '#' ) {
push @{ $rtok_hash->{$tok} }, ( $jl, $jr );
- $nr++;
+ $nr++;
}
}
}
- # Set a line break if no matching tokens between these lines
+ # Set a line break if no matching tokens between these lines
if ( $nr == 0 && $nl > 0 ) {
$rnew_lines->[$jl]->{_end_group} = 1;
}
}
# Look for if/else/elsif and ternary blocks
- my $is_full_block;
+ my $is_full_block;
foreach my $tok ( keys %token_line_count ) {
if ( $token_line_count{$tok} == $nlines ) {
if ( $tok =~ /^\?/ || $tok =~ /^\{\d+if/ ) {
- $is_full_block = 1;
+ $is_full_block = 1;
}
}
}
}
} # End loop over subgroups
- return;
+ return;
}
sub decide_if_aligned_pair {
package Perl::Tidy::VerticalAligner::Alignment;
use strict;
use warnings;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
{
package Perl::Tidy::VerticalAligner::Line;
use strict;
use warnings;
-our $VERSION = '20190601.01';
+our $VERSION = '20190915';
{