From: Steve Hancock Date: Sun, 6 Feb 2022 02:15:17 +0000 (-0800) Subject: update random tester X-Git-Tag: 20220217~10 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=52342fc3f459ca410d404882220f8a82c2842e1c;p=perltidy.git update random tester --- diff --git a/dev-bin/perltidy_random_setup.pl b/dev-bin/perltidy_random_setup.pl index 9b4da0a5..bfba56b8 100755 --- a/dev-bin/perltidy_random_setup.pl +++ b/dev-bin/perltidy_random_setup.pl @@ -41,8 +41,8 @@ else { } # see if DEVEL_MODE is set, turn it on if not -if ($perltidy eq "./perltidy.pl") { - check_DEVEL_MODE($perltidy); +if ( $perltidy eq "./perltidy.pl" ) { + check_DEVEL_MODE($perltidy); } query(< ^ & .. :: << >> ** && .. || // -> => += + -= .= %= &= |= ^= *= <> <= >= == =~ !~ != ++ -- /= x= ~~ ~. |. &. ^. + ... **= <<= >>= &&= ||= //= <=> !~~ &.= |.= ^.= <<~ <<>> CORE:: + #; + push @token_types, '#'; + push @token_types, ','; + + my @valign_list = qw# + = **= += *= &= <<= &&= -= /= |= >>= ||= //= .= %= ^= x= + { ( ? : , ; => && || ~~ !~~ =~ !~ // <=> -> + if unless and or err for foreach while until + #; + + my @valign_exclude_all = qw( * * ); + my @operators = qw(% + - * / x != == >= <= =~ !~ < > | & = **= += *= &= <<= &&= -= /= |= >>= ||= //= .= %= ^= x=); my @keywords = qw(my our local do while if garbage1 34 ); @@ -1117,6 +1133,7 @@ EOM 'keyword-group-blanks-after' => [ 0, 2 ], 'space-prototype-paren' => [ 0, 2 ], + 'break-after-labels' => [ 0, 2 ], # Arbitrary limits to keep things readable 'blank-lines-after-opening-block' => [ 0, 4 ], @@ -1142,6 +1159,9 @@ EOM 'nowant-left-space' => \@operators, 'nowant-right-space' => \@operators, + 'keep-old-breakpoints-after' => \@token_types, + 'keep-old-breakpoints-before' => \@token_types, + #'keyword-group-blanks-list=s 'keyword-group-blanks-size' => [ 0, 2, 4, 7, 10, 2.8, 1.8 ], @@ -1149,6 +1169,9 @@ EOM 'space-after-keyword' => \@keywords, 'nospace-after-keyword' => \@keywords, + 'valign-exclusion-list' => \@valign_exclude_all, + 'valign-inclusion-list' => \@valign_list, + 'html-color-background' => \@colors, 'html-color-bareword' => \@colors, 'html-color-colon' => \@colors, @@ -1171,14 +1194,18 @@ EOM ); my %is_multiword_list = ( - 'want-break-after' => 1, - 'want-break-before' => 1, - 'want-left-space' => 1, - 'want-right-space' => 1, - 'nowant-left-space' => 1, - 'nowant-right-space' => 1, - 'space-after-keyword' => 1, - 'nospace-after-keyword' => 1, + 'want-break-after' => 1, + 'want-break-before' => 1, + 'want-left-space' => 1, + 'want-right-space' => 1, + 'nowant-left-space' => 1, + 'nowant-right-space' => 1, + 'space-after-keyword' => 1, + 'nospace-after-keyword' => 1, + 'keep-old-breakpoints-after' => 1, + 'keep-old-breakpoints-before' => 1, + 'valign-exclusion-list' => 0, + 'valign-inclusion-list' => 1, ); ################################################################### @@ -1254,10 +1281,9 @@ EOM if ( $name =~ /-(list|prefix)/ || $name =~ /character-encoding/ ) { - next; + next unless ( $name =~ /^valign-/ ); } } - my $rrange = $option_range{$name}; ##print "$parameter => $name $flag $type\n"; my $line = ""; @@ -1273,6 +1299,7 @@ EOM my $count = 1; if ( $is_multiword_list{$name} ) { $count = $imax / 2 + 1; + if ( $count > 10 ) { $count = 10 } } foreach my $i ( 1 .. $count ) { my $index = int( rand($imax) + 0.5 );