my @q;
- # Removed =~ from list to improve chances of alignment
- # Removed // from list to improve chances of alignment (RT# 119588)
+ # replaced =~ in the list
+ # TESTING: replaced. Removed // from list to improve chances of alignment (RT# 119588)
@q = qw#
= **= += *= &= <<= &&= -= /= |= >>= ||= //= .= %= ^= x=
- { ? : => && || ~~ !~~
+ { ? : => && || ~~ !~~ =~ //
#;
@is_vertical_alignment_type{@q} = (1) x scalar(@q);
$vert_last_nonblank_block_type = '';
# look at each token in this output line..
+ my $count=0;
foreach my $i ( $ibeg .. $iend ) {
my $alignment_type = '';
my $type = $types_to_go[$i];
$alignment_type = $vert_last_nonblank_type;
}
+ #--------------------------------------------------------
+ # patch for =~ operator. We only align this if it
+ # is the first operator in a line, and the line is a simple
+ # statement. Aligning them within a statement causes
+ # interferes with other good alignments.
+ #--------------------------------------------------------
+ if ( $alignment_type eq '=~' ) {
+ my $terminal_type = $types_to_go[$i_terminal];
+ if ( $count > 0 || $max_line > 0 || $terminal_type ne ';' )
+ {
+ $alignment_type = "";
+ }
+ }
+
#--------------------------------------------------------
# then store the value
#--------------------------------------------------------
$matching_token_to_go[$i] = $alignment_type;
+ $count++ if ($alignment_type);
if ( $type ne 'b' ) {
$vert_last_nonblank_type = $type;
$vert_last_nonblank_token = $token;
my $group_list_type = $group_lines[0]->get_list_type();
+ # See if these two lines have leading equals type tokens
+ my $rtokens = $group_lines[0]->get_rtokens();
+ my $leading_equals = $rtokens->[0] =~ /=/;
+
my $do_not_align = (
# always align lists
!$group_list_type
+ # always align lines with leading equality operators
+ && !$leading_equals
+
&& (
- # don't align if it was just a marginal match
+ # don't align if it was marked as a 'marginal" match
$marginal_match
# don't align two lines with big gap
|| $group_maximum_gap > 12
- # or lines with differing number of alignment tokens
- # TODO: this could be improved. It occasionally rejects
- # good matches.
- || $previous_maximum_jmax_seen != $previous_minimum_jmax_seen
+ # don't align lines with differing number of alignment tokens
+ || ( $previous_maximum_jmax_seen != $previous_minimum_jmax_seen )
)
);
=head2 2018 02 20.01
+ - The packaging for this version has changed. The Tidy.pm file has
+ been split into a smaller Tidy.pm file plus supporting modules in the path
+ Perl/Tidy/*.
+
- Fixed RT #126965, in which a ternary operator was misparsed if immediately
following a function call without arguments, such as:
my $restrict_customer = shift ? 1 : 0;
stamp on certain closing side comments. We need to avoid this in order
to test this feature in an installation test.
- - The packaging for this version has changed. The Tidy.pm file has
- been split into a smaller Tidy.pm file plus supporting modules in the path
- Perl/Tidy/*.
+ - Vertical alignment has been improved in several ways. Thanks especially to
+ Glenn for sending helpful snippets.
+
+ - In many cases, two lines which were previously left unaligned are now
+ aligned.
+
+ OLD:
+ $expect = "1$expect" if $expect =~ /^e/i;
+ $p = "1$p" if defined $p and $p =~ /^e/i;
+
+ NEW:
+ $expect = "1$expect" if $expect =~ /^e/i;
+ $p = "1$p" if defined $p and $p =~ /^e/i;
+
+ - Alignment of the =~ operators has been reactivated.
+
+ OLD:
+ $service_profile =~ s/^\s+|\s+$//g;
+ $host_profile =~ s/^\s+|\s+$//g;
+
+ NEW:
+ $service_profile =~ s/^\s+|\s+$//g;
+ $host_profile =~ s/^\s+|\s+$//g;
+
+ - Alignment of the // operator has been reactivated.
+
+ OLD:
+ is( pop // 7, 7, 'pop // ... works' );
+ is( pop() // 7, 0, 'pop() // ... works' );
+ is( pop @ARGV // 7, 3, 'pop @array // ... works' );
+
+ NEW:
+ is( pop // 7, 7, 'pop // ... works' );
+ is( pop() // 7, 0, 'pop() // ... works' );
+ is( pop @ARGV // 7, 3, 'pop @array // ... works' );
+
=head2 2018 02 20
# remove spaces around arrows
-my $obj = Bio::Variation::AAChange->new;
+my $obj = Bio::Variation::AAChange->new;
my $termcap = Term::Cap->Tgetent( { TERM => undef } );
my $a = ${^WARNING_BITS};
@{^HOWDY_PARDNER} = ( 101, 102 );
-${^W} = 1;
+${^W} = 1;
$bb[$^]] = "bubba";
$l[$i] = $u;
chomp( $l[$i] );
$w[$i] = $t;
- $t = 1000000;
+ $t = 1000000;
}
else { $l[$i] = $q[$z]; $w[$i] = $p[$z]; $z++; }
print $l[$i], "\t", $w[$i], "\r\n";
# **This script was automatically generated**
# Created with: ./make_t.pl
-# Sat Nov 10 08:48:22 2018
+# Sun Nov 11 06:54:11 2018
# To locate test #13 for example, search for the string '#13'
# **This script was automatically generated**
# Created with: ./make_t.pl
-# Sat Nov 10 08:48:23 2018
+# Sun Nov 11 06:54:12 2018
# To locate test #13 for example, search for the string '#13'
# **This script was automatically generated**
# Created with: ./make_t.pl
-# Sat Nov 10 08:48:23 2018
+# Sun Nov 11 06:54:12 2018
# To locate test #13 for example, search for the string '#13'
$l[$i] = $u;
chomp( $l[$i] );
$w[$i] = $t;
- $t = 1000000;
+ $t = 1000000;
}
else { $l[$i] = $q[$z]; $w[$i] = $p[$z]; $z++; }
print $l[$i], "\t", $w[$i], "\r\n";
# **This script was automatically generated**
# Created with: ./make_t.pl
-# Sat Nov 10 08:48:23 2018
+# Sun Nov 11 06:54:12 2018
# To locate test #13 for example, search for the string '#13'
# **This script was automatically generated**
# Created with: ./make_t.pl
-# Sat Nov 10 08:48:22 2018
+# Sun Nov 11 06:54:11 2018
# To locate test #13 for example, search for the string '#13'
params => "def",
expect => <<'#2...........',
# remove spaces around arrows
-my $obj = Bio::Variation::AAChange->new;
+my $obj = Bio::Variation::AAChange->new;
my $termcap = Term::Cap->Tgetent( { TERM => undef } );
#2...........
},
expect => <<'#18...........',
my $a = ${^WARNING_BITS};
@{^HOWDY_PARDNER} = ( 101, 102 );
-${^W} = 1;
+${^W} = 1;
$bb[$^]] = "bubba";
#18...........
},
# **This script was automatically generated**
# Created with: ./make_t.pl
-# Sat Nov 10 08:48:22 2018
+# Sun Nov 11 06:54:11 2018
# To locate test #13 for example, search for the string '#13'
# **This script was automatically generated**
# Created with: ./make_t.pl
-# Sat Nov 10 08:48:22 2018
+# Sun Nov 11 06:54:11 2018
# To locate test #13 for example, search for the string '#13'
# **This script was automatically generated**
# Created with: ./make_t.pl
-# Sat Nov 10 08:48:22 2018
+# Sun Nov 11 06:54:11 2018
# To locate test #13 for example, search for the string '#13'
# **This script was automatically generated**
# Created with: ./make_t.pl
-# Sat Nov 10 08:48:22 2018
+# Sun Nov 11 06:54:11 2018
# To locate test #13 for example, search for the string '#13'
# **This script was automatically generated**
# Created with: ./make_t.pl
-# Sat Nov 10 08:48:22 2018
+# Sun Nov 11 06:54:11 2018
# To locate test #13 for example, search for the string '#13'
# **This script was automatically generated**
# Created with: ./make_t.pl
-# Sat Nov 10 08:48:23 2018
+# Sun Nov 11 06:54:11 2018
# To locate test #13 for example, search for the string '#13'
# **This script was automatically generated**
# Created with: ./make_t.pl
-# Sat Nov 10 08:48:23 2018
+# Sun Nov 11 06:54:11 2018
# To locate test #13 for example, search for the string '#13'