From 9a97dba0e59f6e186b7f898abcc710c417c4b5c4 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Tue, 12 Jan 2021 15:50:21 -0800 Subject: [PATCH] fix unusual blinker related to large -ci and -mft=n --- lib/Perl/Tidy/Formatter.pm | 2 ++ local-docs/BugLog.pod | 21 +++++++++++++++++++++ t/snippets/README.md | 6 ++++++ 3 files changed, 29 insertions(+) diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 6bc33412..ddf2d818 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -10651,6 +10651,8 @@ EOM || ( $comma_count_in_batch && ( $rOpts_maximum_fields_per_table > 0 + && $rOpts_maximum_fields_per_table <= + $comma_count_in_batch || $rOpts_comma_arrow_breakpoints == 0 ) ) diff --git a/local-docs/BugLog.pod b/local-docs/BugLog.pod index 0fe5c94d..29de28bc 100644 --- a/local-docs/BugLog.pod +++ b/local-docs/BugLog.pod @@ -2,6 +2,27 @@ =over 4 +=item B + +The following blinker was found in random testing. The following statement +(with @j starting at level 0) + + @j = ( $x, $y, $z ); + +run with the following profile + + --indent-columns=5 + --continuation-indentation=7 + --maximum-line-length=20 + --break-before-paren-and-indent=2 + --break-before-paren=2 + --maximum-fields-per-table=4 + +caused an oscillation between two states. An unusual feature which contributed +to the problem is the very large ci value. This is fixed in a patch made 12 Jan +2021. + + =item B The indentation of multiline qw quotes runs into problems when there is nesting, diff --git a/t/snippets/README.md b/t/snippets/README.md index 6780210e..28fd1cd7 100644 --- a/t/snippets/README.md +++ b/t/snippets/README.md @@ -203,3 +203,9 @@ To update the list of covered parameters, run ``` make_coverage_report.pl ``` + +This shows which parameters are included in test cases. Most are covered, +and when new parameters are added there should also be corresponding test +cases added. But a problem is that perltidy has so many parameters that it is +not possible to write enough tests to test all combinations. This problem +is addressed with the random testing scripts in the ```git/dev-bin``` directory. -- 2.39.5