From d2c39255c7b807c1d736f2385b643f214a3ad8f9 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Tue, 26 Nov 2024 09:51:51 -0800 Subject: [PATCH] fix b1501 --- dev-bin/run_convergence_tests.pl.data | 33 ++++++++ dev-bin/run_convergence_tests.pl.expect | 107 +++++++++++++++--------- lib/Perl/Tidy/Formatter.pm | 6 +- 3 files changed, 107 insertions(+), 39 deletions(-) diff --git a/dev-bin/run_convergence_tests.pl.data b/dev-bin/run_convergence_tests.pl.data index 4e2f20a7..82b85529 100644 --- a/dev-bin/run_convergence_tests.pl.data +++ b/dev-bin/run_convergence_tests.pl.data @@ -12501,6 +12501,39 @@ $config = { --keep-old-breakpoints-after='t q .= ^.= .. i x R -> J' --break-at-trailing-comma-types='1' +==> b1501.in <== +my%S3d_url=( + 'emotif'=>$SGD_stem_url{'s3d'} + .'seq_search.pl?db=emotif&gene=', + 'pfam'=>$SGD_stem_url{'s3d'}.'seq_search.pl?db=pfam&gene=', + 'pfam_uk'=>$SGD_stem_url{'s3d'} + .'seq_search.pl?db=pfam&loc=uk&gene=', + 'pfam_us'=>$SGD_stem_url{'s3d'} + .'seq_search.pl?db=pfam&loc=us&gene=', + 'blast_nr'=>$SGD_stem_url{'s3d'}.'getblast?db=nr&name=', + 'blast_est'=>$SGD_stem_url{'s3d'}.'getblast?db=est&name=', + 'blast_mammal'=>$SGD_stem_url{'s3d'} + .'getblast?db=mammal&name=', + 'blast_human'=>$SGD_stem_url{'s3d'} + .'getblast?db=human&name=', + 'blast_worm'=>$SGD_stem_url{'s3d'} + .'getblast?db=worm&name=', + 'blast_yeast'=>$SGD_stem_url{'s3d'} + .'getblast?db=yeast&name=', + 'blast_worm_yeast'=>$SGD_stem_url{'s3d'} + .'getblast?db=worm&query=worm&name=', + 'patmatch'=>$SGD_stem_url{'s3d2'}.'grepmatch?',##comment + 'grepmatch'=>$SGD_stem_url{'s3d2'}.'grepmatch?', + 'pdb_neighbors'=>$SGD_stem_url{'s3d'} + .'pdb_neighbors?id=CHAIN&gene=ORF_NAME' +); + +==> b1501.par <== +--maximum-line-length=61 +--indent-columns=3 +--noadd-whitespace +--extended-line-up-parentheses + ==> b156.in <== # State 1 { diff --git a/dev-bin/run_convergence_tests.pl.expect b/dev-bin/run_convergence_tests.pl.expect index b107cee7..6f91b8a1 100644 --- a/dev-bin/run_convergence_tests.pl.expect +++ b/dev-bin/run_convergence_tests.pl.expect @@ -7892,10 +7892,11 @@ BEGIN { qw( *_RemoteIPAddr V_SessionType ) ], 0x93 => [ - ConfigStat =>qw( Z16_DeviceName V_StationUserID - V_StationUserInstance - Z16_UserName Z16_ServerName - V_NumberLines V_NumberSpeedDials ) + ConfigStat => + qw( Z16_DeviceName V_StationUserID + V_StationUserInstance + Z16_UserName Z16_ServerName + V_NumberLines V_NumberSpeedDials ) ], ) ; } @@ -7907,10 +7908,11 @@ BEGIN { qw( *_RemoteIPAddr V_SessionType ) ], 0x93 => [ - ConfigStat =>qw( Z16_DeviceName V_StationUserID - V_StationUserInstance - Z16_UserName Z16_ServerName - V_NumberLines V_NumberSpeedDials ) + ConfigStat => + qw( Z16_DeviceName V_StationUserID + V_StationUserInstance + Z16_UserName Z16_ServerName + V_NumberLines V_NumberSpeedDials ) ], ) ; } @@ -8118,50 +8120,51 @@ sub new{ }, ], [ - '@1-3', - 0, - sub{parse_value($_[2]->{ENCODING});}, + '@1-3', + 0, + sub{parse_value($_[2]->{ENCODING});}, ], ['params',0,sub{{}},], [ - 'params', - 3, - sub{ - my%hash; - for(my$i=0;$i<@{$_[3]};$i+=2){ - push@{$hash{$_[3]->[$i]}},$_[3]->[$i+1]; - } - \%hash; - }, + 'params', + 3, + sub{ + my%hash; + for(my$i=0;$i<@{$_[3]};$i+=2){ + push@{$hash{$_[3]->[$i]}},$_[3]->[$i+1]; + } + \%hash; + }, ], [ - 'paramlist', - 1, - sub{$_[1]}, + 'paramlist', + 1, + sub{$_[1]}, ], [ - 'paramlist', - 5, - sub{ - unshift(@{$_[1]},@{$_[5]},)if defined$_[5]; - $_[1]; - }, + 'paramlist', + 5, + sub{ + unshift(@{$_[1]},@{$_[5]},)if defined$_[5]; + $_[1]; + }, ], [ - 'param', - 5, - sub{[uc($_[1]),uc($_[5]),]}, + 'param', + 5, + sub{[uc($_[1]),uc($_[5]),]}, ], ['addressparts',1,sub{{"address",$_[1],}},], [ - 'addressparts', - 3, - sub{{"address",$_[1],"address2",$_[3],}}, + 'addressparts', + 3, + sub{{"address",$_[1],"address2",$_[3],}}, ], [ - 'addressparts', - 5, - sub{{"address",$_[1],"address2",$_[3],"street",$_[5],}}, + 'addressparts', + 5, + sub{{"address",$_[1],"address2",$_[3],"street",$_[5], + }}, ], ], @_, @@ -8449,6 +8452,34 @@ $config = { ppid => $$, }; +==> b1501 <== +my%S3d_url=( + 'emotif'=>$SGD_stem_url{'s3d'} + .'seq_search.pl?db=emotif&gene=', + 'pfam'=>$SGD_stem_url{'s3d'} + .'seq_search.pl?db=pfam&gene=', + 'pfam_uk'=>$SGD_stem_url{'s3d'} + .'seq_search.pl?db=pfam&loc=uk&gene=', + 'pfam_us'=>$SGD_stem_url{'s3d'} + .'seq_search.pl?db=pfam&loc=us&gene=', + 'blast_nr'=>$SGD_stem_url{'s3d'}.'getblast?db=nr&name=', + 'blast_est'=>$SGD_stem_url{'s3d'}.'getblast?db=est&name=', + 'blast_mammal'=>$SGD_stem_url{'s3d'} + .'getblast?db=mammal&name=', + 'blast_human'=>$SGD_stem_url{'s3d'} + .'getblast?db=human&name=', + 'blast_worm'=>$SGD_stem_url{'s3d'} + .'getblast?db=worm&name=', + 'blast_yeast'=>$SGD_stem_url{'s3d'} + .'getblast?db=yeast&name=', + 'blast_worm_yeast'=>$SGD_stem_url{'s3d'} + .'getblast?db=worm&query=worm&name=', + 'patmatch'=>$SGD_stem_url{'s3d2'}.'grepmatch?',##comment + 'grepmatch'=>$SGD_stem_url{'s3d2'}.'grepmatch?', + 'pdb_neighbors'=>$SGD_stem_url{'s3d'} + .'pdb_neighbors?id=CHAIN&gene=ORF_NAME' +); + ==> b156 <== # State 1 { diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index daf4ea64..9d7b1957 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -34970,10 +34970,14 @@ EOM } $available_spaces = $test_space_count - $min_gnu_indentation; + # Fix for combo -naws and -xlp (b1501; also b1466) + my $tol = !$rOpts_add_whitespace + && $rOpts_extended_line_up_parentheses ? 1 : 0; + # Do not startup -lp indentation mode if no space ... # ... or if it puts the opening far to the right if ( !$in_lp_mode - && ( $available_spaces <= 0 || $next_opening_too_far ) ) + && ( $available_spaces <= $tol || $next_opening_too_far ) ) { $space_count += $standard_increment; $available_spaces = 0; -- 2.39.5