From 7317e9603b73ef3a4103232a355076f2b50811db Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Sun, 26 Apr 2020 16:06:08 -0700 Subject: [PATCH] add tests for -fs -fsb -fse -trp, update some docs --- bin/perltidy | 3 + t/snippets/comments.in | 12 +- t/snippets/comments1.par | 3 +- t/snippets/comments3.par | 4 +- t/snippets/comments4.par | 3 +- t/snippets/coverage_missing.txt | 4 - t/snippets/coverage_values.txt | 816 ++++++++++++++------------- t/snippets/expect/comments.comments1 | 9 +- t/snippets/expect/comments.comments2 | 4 +- t/snippets/expect/comments.comments3 | 16 +- t/snippets/expect/comments.comments4 | 12 +- t/snippets/expect/comments.comments5 | 9 +- t/snippets/expect/comments.def | 9 +- t/snippets/packing_list.txt | 2 +- t/snippets17.t | 72 ++- t/snippets18.t | 21 +- 16 files changed, 547 insertions(+), 452 deletions(-) diff --git a/bin/perltidy b/bin/perltidy index ecb90cb8..5e4388a6 100755 --- a/bin/perltidy +++ b/bin/perltidy @@ -1659,6 +1659,9 @@ The B<-fsb=string> is the corresponding parameter used to change the ending marker for format skipping. The default is equivalent to -fse='#<<<'. +The beginning and ending strings may be the same, but it is preferable +to make them different for clarity. + =back =head2 Line Break Control diff --git a/t/snippets/comments.in b/t/snippets/comments.in index 9328f6f3..6edda543 100644 --- a/t/snippets/comments.in +++ b/t/snippets/comments.in @@ -46,7 +46,7 @@ sub macro_get_names { # } # end level 1 -#<<< do not let perltidy touch this +#<<< do not let perltidy touch this unless -nfs is set my @list = (1, 1, 1, 1, 2, 1, @@ -54,6 +54,14 @@ sub macro_get_names { # 1, 4, 6, 4, 1,); #>>> +#<< test alternate format skipping string + my @list = (1, + 1, 1, + 1, 2, 1, + 1, 3, 3, 1, + 1, 4, 6, 4, 1,); +#>> + # some blank lines follow @@ -72,7 +80,7 @@ __END__ =pod -Some pod after __END__ to delete with -dp +Some pod after __END__ to delete with -dp and trim with -trp =cut diff --git a/t/snippets/comments1.par b/t/snippets/comments1.par index b093922b..d96fddc3 100644 --- a/t/snippets/comments1.par +++ b/t/snippets/comments1.par @@ -3,4 +3,5 @@ # --noindent-block-comments, # --nohanging-side-comments # --static-side-comments --fpsc=40 -iscl -nibc -nhsc -ssc +# --trim-pod +-fpsc=40 -iscl -nibc -nhsc -ssc -trp diff --git a/t/snippets/comments3.par b/t/snippets/comments3.par index 31726c69..a7e7943e 100644 --- a/t/snippets/comments3.par +++ b/t/snippets/comments3.par @@ -1,2 +1,2 @@ -# testing --maximum-consecutive-blank-lines=2 and --indent-spaced-block-comments --mbl=2 -isbc +# testing --maximum-consecutive-blank-lines=2 and --indent-spaced-block-comments --no-format-skipping +-mbl=2 -isbc -nfs diff --git a/t/snippets/comments4.par b/t/snippets/comments4.par index a209e305..e250e665 100644 --- a/t/snippets/comments4.par +++ b/t/snippets/comments4.par @@ -1,4 +1,5 @@ # testing --keep-old-blank-lines=2 [=all] and # --nooutdent-long-comments and # --outdent-static-block-comments --kbl=2 -nolc -osbc +# --format-skipping-begin and --format-skipping-end +-kbl=2 -nolc -osbc -fsb='#<{2,}' -fse='#>{2,}' diff --git a/t/snippets/coverage_missing.txt b/t/snippets/coverage_missing.txt index 7b344de3..7d26b919 100644 --- a/t/snippets/coverage_missing.txt +++ b/t/snippets/coverage_missing.txt @@ -26,9 +26,6 @@ dump-want-right-space extended-syntax file-size-order force-read-binary -format-skipping -format-skipping-begin -format-skipping-end frames help html @@ -137,7 +134,6 @@ tee-block-comments tee-pod tee-side-comments title -trim-pod trim-qw use-unicode-gcstring valign diff --git a/t/snippets/coverage_values.txt b/t/snippets/coverage_values.txt index a86420eb..ce53982f 100644 --- a/t/snippets/coverage_values.txt +++ b/t/snippets/coverage_values.txt @@ -1,524 +1,538 @@ $VAR1 = { - 'sub-alias-list' => [ - 'method fun' + 'brace-left-and-indent-list' => [ + 'if' + ], + 'opening-anonymous-sub-brace-on-new-line' => [ + 0, + 1 + ], + 'maximum-fields-per-table' => [ + 0 + ], + 'blank-lines-after-opening-block' => [ + 2 + ], + 'starting-indentation-level' => [ + 0 + ], + 'cuddled-else' => [ + 0, + 1 + ], + 'paren-tightness' => [ + 0, + 1, + 2 + ], + 'perl-syntax-check-flags' => [ + '-c -T' + ], + 'outdent-labels' => [ + 0, + 1 ], 'space-function-paren' => [ 0, 1 ], + 'timestamp' => [ + 0, + 1 + ], + 'closing-side-comment-maximum-text' => [ + 20, + 40 + ], + 'ignore-old-breakpoints' => [ + 0, + 1 + ], + 'closing-brace-indentation' => [ + 0, + 1, + 2 + ], + 'blank-lines-before-closing-block' => [ + 1 + ], + 'break-at-old-comma-breakpoints' => [ + 0, + 1 + ], 'delete-pod' => [ 0, 1 ], - 'blank-lines-before-closing-block' => [ - 1 + 'brace-vertical-tightness-closing' => [ + 0, + 2 ], - 'delete-block-comments' => [ - 0, - 1 - ], - 'square-bracket-tightness' => [ - 0, - 1, - 2 - ], - 'closing-side-comment-else-flag' => [ - 0 - ], - 'one-line-block-nesting' => [ + 'want-right-space' => [ + '= .= =~ !~ ? :', + '= / *' + ], + 'keyword-group-blanks-delete' => [ + 0, + 1 + ], + 'indent-columns' => [ + 0, + 2, + 4 + ], + 'weld-nested-containers' => [ 0, 1 ], - 'indent-closing-brace' => [ - 0, - 1 - ], - 'blanks-before-blocks' => [ - 0, + 'closing-side-comments' => [ + 0, + 1 + ], + 'cuddled-break-option' => [ 1 ], - 'break-before-all-operators' => [ - 0, - 1 - ], - 'want-left-space' => [ - '+ -', - '= .= =~ !~ :' - ], - 'closing-side-comments-balanced' => [ - 0, - 1 - ], - 'square-bracket-vertical-tightness-closing' => [ - 0, - 2 - ], - 'short-concatenation-item-length' => [ - 12, - 8 - ], - 'space-terminal-semicolon' => [ + 'space-prototype-paren' => [ + 0, + 1, + 2 + ], + 'stack-opening-hash-brace' => [ 0, 1 ], - 'delete-semicolons' => [ - 0, - 1 - ], - 'keyword-group-blanks-size' => [ - '5' - ], - 'iterations' => [ - 1 - ], - 'outdent-long-quotes' => [ - 0, - 1 - ], - 'block-brace-vertical-tightness' => [ + 'add-whitespace' => [ + 0, + 1 + ], + 'static-block-comments' => [ + 0, + 1 + ], + 'trim-pod' => [ + 0, + 1 + ], + 'closing-side-comments-balanced' => [ 0, 1 ], - 'stack-closing-paren' => [ + 'long-block-line-count' => [ + 8 + ], + 'maximum-line-length' => [ 0, - 1 + 1, + 100, + 100000, + 160, + 77, + 78, + 80 ], - 'default-tabsize' => [ - 8 - ], - 'closing-side-comments' => [ + 'backup-and-modify-in-place' => [ + 0, + 1 + ], + 'delete-semicolons' => [ + 0, + 1 + ], + 'outdent-long-comments' => [ 0, 1 ], - 'delete-old-whitespace' => [ + 'check-syntax' => [ + 0, + 1 + ], + 'delete-side-comments' => [ + 0, + 1 + ], + 'hanging-side-comments' => [ 0, 1 ], + 'entab-leading-whitespace' => [ + 8 + ], + 'one-line-block-semicolons' => [ + 0, + 1, + 2 + ], + 'stack-closing-block-brace' => [ + 0, + 1 + ], + 'add-newlines' => [ + 0, + 1 + ], 'keyword-group-blanks-before' => [ 1, 2 ], - 'space-backslash-quote' => [ - 0, - 1, - 2 - ], - 'cuddled-break-option' => [ + 'indent-spaced-block-comments' => [ + 0, + 1 + ], + 'indent-closing-brace' => [ + 0, 1 ], - 'closing-square-bracket-indentation' => [ - 0, - 1, - 2 - ], - 'keyword-group-blanks-inside' => [ - 0, - 1 - ], + 'character-encoding' => [ + 'guess' + ], + 'opening-sub-brace-on-new-line' => [ + 0, + 1 + ], + 'add-semicolons' => [ + 0, + 1 + ], + 'paren-vertical-tightness-closing' => [ + 0, + 2 + ], + 'nospace-after-keyword' => [ + 'my for' + ], + 'delete-old-newlines' => [ + 0, + 1 + ], 'paren-vertical-tightness' => [ 0, 1, 2 ], - 'brace-tightness' => [ + 'nowant-right-space' => [ + '+ -', + '++ --', + '..', + '= + - / *', + 'A' + ], + 'format-skipping' => [ 0, - 1, - 2 + 1 ], + 'brace-left-and-indent' => [ + 0, + 1 + ], 'delete-closing-side-comments' => [ 0, 1 ], - 'format' => [ - 'html', - 'tidy' - ], + 'closing-side-comment-else-flag' => [ + 0 + ], + 'opening-paren-right' => [ + 0, + 1 + ], + 'outdent-static-block-comments' => [ + 0, + 1 + ], + 'keep-old-blank-lines' => [ + 0, + 1, + 2 + ], + 'break-before-all-operators' => [ + 0, + 1 + ], 'space-for-semicolon' => [ 0, 1 ], - 'nospace-after-keyword' => [ - 'my for' - ], - 'standard-error-output' => [ - 0, - 1 - ], - 'opening-brace-on-new-line' => [ - 0, - 1 - ], - 'ignore-side-comment-lengths' => [ - 0, - 1 - ], - 'static-block-comments' => [ - 0, - 1 - ], - 'square-bracket-vertical-tightness' => [ - 0, - 1, - 2 - ], 'want-break-before' => [ ' ', '% + - * / x != == >= <= =~ !~ < > | & = **= += *= &= <<= &&= -= /= |= >>= ||= //= .= %= ^= x=', '% + - * / x != == >= <= =~ < > | & **= += *= &= <<= &&= -= /= |= >>= ||= .= %= ^= x=', '=' ], - 'block-brace-tightness' => [ - 0, - 1, - 2 - ], - 'brace-left-and-indent-list' => [ - 'if' - ], - 'closing-side-comment-maximum-text' => [ - 20, - 40 - ], - 'entab-leading-whitespace' => [ - 8 - ], - 'break-at-old-semicolon-breakpoints' => [ - 0, - 1 - ], - 'space-keyword-paren' => [ - 0, - 1 + 'blank-lines-before-subs' => [ + 0, + 1 + ], + 'one-line-block-nesting' => [ + 0, + 1 + ], + 'space-after-keyword' => [ + 'push' ], - 'closing-side-comment-interval' => [ - 2, - 20, - 6 - ], - 'indent-columns' => [ - 0, - 2, - 4 - ], - 'variable-maximum-line-length' => [ + 'break-after-all-operators' => [ + 0, + 1 + ], + 'opening-square-bracket-right' => [ 0, 1 ], - 'add-newlines' => [ - 0, - 1 - ], - 'stack-opening-hash-brace' => [ + 'outdent-long-quotes' => [ + 0, + 1 + ], + 'stack-opening-paren' => [ + 0, + 1 + ], + 'maximum-consecutive-blank-lines' => [ + 0, + 1, + 2 + ], + 'stack-closing-hash-brace' => [ 0, 1 ], - 'add-whitespace' => [ - 0, - 1 - ], - 'stack-closing-square-bracket' => [ - 0, - 1 - ], 'comma-arrow-breakpoints' => [ 1, 5 ], - 'keyword-group-blanks-repeat-count' => [ - 0 + 'fixed-position-side-comment' => [ + 40 + ], + 'blank-lines-before-closing-block-list' => [ + '*' + ], + 'keyword-group-blanks-inside' => [ + 0, + 1 + ], + 'want-break-after' => [ + '% + - * / x != == >= <= =~ !~ < > | & >= < = **= += *= &= <<= &&= -= /= |= >>= ||= .= %= ^= x= . << >> -> && ||' + ], + 'square-bracket-vertical-tightness-closing' => [ + 0, + 2 + ], + 'square-bracket-tightness' => [ + 0, + 1, + 2 + ], + 'break-at-old-method-breakpoints' => [ + 0, + 1 + ], + 'square-bracket-vertical-tightness' => [ + 0, + 1, + 2 ], - 'closing-brace-indentation' => [ - 0, - 1, - 2 - ], - 'nowant-right-space' => [ - '+ -', - '++ --', - '..', - '= + - / *', - 'A' - ], - 'delete-side-comments' => [ - 0, - 1 - ], - 'long-block-line-count' => [ - 8 - ], - 'keyword-group-blanks-delete' => [ + 'default-tabsize' => [ + 8 + ], + 'ignore-side-comment-lengths' => [ 0, 1 ], - 'tight-secret-operators' => [ - 0, - 1 - ], + 'iterations' => [ + 1 + ], + 'closing-square-bracket-indentation' => [ + 0, + 1, + 2 + ], 'continuation-indentation' => [ 0, 2, 4 ], - 'brace-left-and-indent' => [ + 'nowant-left-space' => [ + '++ -- ?', + '..', + '= + - / *', + '= / *' + ], + 'standard-error-output' => [ 0, 1 ], - 'line-up-parentheses' => [ - 0, - 1 - ], - 'opening-sub-brace-on-new-line' => [ - 0, - 1 - ], - 'opening-paren-right' => [ - 0, - 1 - ], - 'opening-anonymous-sub-brace-on-new-line' => [ - 0, - 1 - ], - 'want-right-space' => [ - '= .= =~ !~ ? :', - '= / *' - ], - 'delete-old-newlines' => [ - 0, - 1 + 'blanks-before-blocks' => [ + 0, + 1 + ], + 'closing-paren-indentation' => [ + 0, + 1, + 2 + ], + 'format-skipping-end' => [ + '#>{2,}' ], - 'stack-closing-hash-brace' => [ + 'keyword-group-blanks-repeat-count' => [ + 0 + ], + 'backup-file-extension' => [ + 'bak', + '~' + ], + 'keyword-group-blanks-after' => [ + 1, + 2 + ], + 'keep-interior-semicolons' => [ 0, 1 ], - 'starting-indentation-level' => [ - 0 - ], - 'backup-and-modify-in-place' => [ - 0, - 1 - ], - 'perl-syntax-check-flags' => [ - '-c -T' - ], - 'keep-interior-semicolons' => [ + 'keyword-group-blanks-size' => [ + '5' + ], + 'space-terminal-semicolon' => [ 0, 1 ], - 'stack-opening-square-bracket' => [ - 0, - 1 - ], - 'outdent-long-comments' => [ - 0, - 1 - ], - 'blank-lines-after-opening-block' => [ - 2 - ], - 'add-semicolons' => [ - 0, - 1 - ], + 'outdent-keywords' => [ + 0, + 1 + ], 'indent-block-comments' => [ 0, 1 ], - 'break-after-all-operators' => [ - 0, - 1 - ], - 'character-encoding' => [ - 'guess' - ], - 'timestamp' => [ + 'blank-lines-before-packages' => [ + 0, + 1 + ], + 'recombine' => [ 0, 1 ], - 'fixed-position-side-comment' => [ - 40 - ], - 'one-line-block-semicolons' => [ - 0, - 1, - 2 - ], - 'fuzzy-line-length' => [ - 0, - 1 - ], - 'brace-vertical-tightness-closing' => [ - 0, - 2 - ], - 'blank-lines-before-subs' => [ - 0, - 1 - ], + 'blank-lines-after-opening-block-list' => [ + '*' + ], + 'stack-opening-square-bracket' => [ + 0, + 1 + ], 'cuddled-block-list' => [ 'map,sort,grep', 'sort,map,grep' ], - 'opening-brace-always-on-right' => [ - 0, - 1 - ], - 'indent-spaced-block-comments' => [ - 0, - 1 - ], - 'recombine' => [ - 0, - 1 - ], - 'backup-file-extension' => [ - 'bak', - '~' + 'space-backslash-quote' => [ + 0, + 1, + 2 ], - 'check-syntax' => [ - 0, - 1 - ], - 'ignore-old-breakpoints' => [ - 0, - 1 - ], - 'static-side-comments' => [ - 0, - 1 - ], - 'minimum-space-to-comment' => [ - 10, - 2, - 4 - ], - 'keyword-group-blanks-after' => [ - 1, - 2 - ], - 'cuddled-else' => [ - 0, - 1 - ], - 'space-after-keyword' => [ - 'push' - ], - 'paren-tightness' => [ - 0, - 1, - 2 + 'want-left-space' => [ + '+ -', + '= .= =~ !~ :' ], - 'stack-opening-paren' => [ - 0, - 1 - ], - 'want-break-after' => [ - '% + - * / x != == >= <= =~ !~ < > | & >= < = **= += *= &= <<= &&= -= /= |= >>= ||= .= %= ^= x= . << >> -> && ||' - ], - 'brace-vertical-tightness' => [ - 0, - 1, - 2 - ], - 'space-prototype-paren' => [ + 'format' => [ + 'html', + 'tidy' + ], + 'fuzzy-line-length' => [ + 0, + 1 + ], + 'block-brace-tightness' => [ 0, 1, 2 ], - 'weld-nested-containers' => [ - 0, - 1 - ], - 'opening-square-bracket-right' => [ - 0, - 1 - ], - 'closing-paren-indentation' => [ - 0, - 1, - 2 - ], 'warning-output' => [ 0, 1 ], - 'paren-vertical-tightness-closing' => [ - 0, - 2 - ], - 'blank-lines-before-closing-block-list' => [ - '*' - ], - 'outdent-static-block-comments' => [ - 0, - 1 - ], - 'nowant-left-space' => [ - '++ -- ?', - '..', - '= + - / *', - '= / *' - ], - 'hanging-side-comments' => [ - 0, - 1 - ], - 'break-at-old-method-breakpoints' => [ - 0, - 1 - ], - 'maximum-consecutive-blank-lines' => [ - 0, - 1, - 2 - ], - 'keep-old-blank-lines' => [ - 0, - 1, - 2 - ], + 'stack-closing-square-bracket' => [ + 0, + 1 + ], 'opening-hash-brace-right' => [ 0, 1 ], - 'outdent-labels' => [ - 0, - 1 - ], - 'maximum-fields-per-table' => [ - 0 - ], - 'break-at-old-comma-breakpoints' => [ + 'block-brace-vertical-tightness' => [ 0, 1 ], - 'blank-lines-before-packages' => [ - 0, - 1 - ], - 'outdent-keywords' => [ - 0, - 1 - ], - 'maximum-line-length' => [ - 0, - 1, - 100, - 100000, - 160, - 77, - 78, - 80 - ], + 'minimum-space-to-comment' => [ + 10, + 2, + 4 + ], + 'opening-brace-always-on-right' => [ + 0, + 1 + ], + 'break-at-old-semicolon-breakpoints' => [ + 0, + 1 + ], 'blanks-before-comments' => [ 0, 1 ], - 'stack-closing-block-brace' => [ + 'delete-old-whitespace' => [ + 0, + 1 + ], + 'closing-side-comment-interval' => [ + 2, + 20, + 6 + ], + 'tight-secret-operators' => [ + 0, + 1 + ], + 'brace-vertical-tightness' => [ + 0, + 1, + 2 + ], + 'space-keyword-paren' => [ + 0, + 1 + ], + 'variable-maximum-line-length' => [ + 0, + 1 + ], + 'short-concatenation-item-length' => [ + 12, + 8 + ], + 'delete-block-comments' => [ + 0, + 1 + ], + 'opening-brace-on-new-line' => [ 0, 1 ], - 'blank-lines-after-opening-block-list' => [ - '*' - ] + 'sub-alias-list' => [ + 'method fun' + ], + 'brace-tightness' => [ + 0, + 1, + 2 + ], + 'line-up-parentheses' => [ + 0, + 1 + ], + 'format-skipping-begin' => [ + '#<{2,}' + ], + 'stack-closing-paren' => [ + 0, + 1 + ], + 'static-side-comments' => [ + 0, + 1 + ] }; diff --git a/t/snippets/expect/comments.comments1 b/t/snippets/expect/comments.comments1 index ba95d6f0..a53e5e62 100644 --- a/t/snippets/expect/comments.comments1 +++ b/t/snippets/expect/comments.comments1 @@ -51,7 +51,7 @@ sub macro_get_names { # } # end level 2 } # end level 1 -#<<< do not let perltidy touch this +#<<< do not let perltidy touch this unless -nfs is set my @list = (1, 1, 1, 1, 2, 1, @@ -59,6 +59,11 @@ sub macro_get_names { # 1, 4, 6, 4, 1,); #>>> +#<< test alternate format skipping string +my @list = ( 1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 6, 4, 1, ); + +#>> + # some blank lines follow =pod @@ -72,7 +77,7 @@ __END__ =pod -Some pod after __END__ to delete with -dp +Some pod after __END__ to delete with -dp and trim with -trp =cut diff --git a/t/snippets/expect/comments.comments2 b/t/snippets/expect/comments.comments2 index 9de359bf..feac27a7 100644 --- a/t/snippets/expect/comments.comments2 +++ b/t/snippets/expect/comments.comments2 @@ -37,7 +37,7 @@ sub macro_get_names { # } # end level 2 } # end level 1 -#<<< do not let perltidy touch this +#<<< do not let perltidy touch this unless -nfs is set my @list = (1, 1, 1, 1, 2, 1, @@ -45,6 +45,8 @@ sub macro_get_names { # 1, 4, 6, 4, 1,); #>>> +my @list = ( 1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 6, 4, 1, ); + __END__ diff --git a/t/snippets/expect/comments.comments3 b/t/snippets/expect/comments.comments3 index 16e819be..ec1cc230 100644 --- a/t/snippets/expect/comments.comments3 +++ b/t/snippets/expect/comments.comments3 @@ -53,14 +53,16 @@ sub macro_get_names { # } # end level 1 -#<<< do not let perltidy touch this - my @list = (1, - 1, 1, - 1, 2, 1, - 1, 3, 3, 1, - 1, 4, 6, 4, 1,); +#<<< do not let perltidy touch this unless -nfs is set +my @list = ( 1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 6, 4, 1, ); + #>>> +#<< test alternate format skipping string +my @list = ( 1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 6, 4, 1, ); + +#>> + # some blank lines follow @@ -77,7 +79,7 @@ __END__ =pod -Some pod after __END__ to delete with -dp +Some pod after __END__ to delete with -dp and trim with -trp =cut diff --git a/t/snippets/expect/comments.comments4 b/t/snippets/expect/comments.comments4 index a6d1e831..e862a51f 100644 --- a/t/snippets/expect/comments.comments4 +++ b/t/snippets/expect/comments.comments4 @@ -54,7 +54,7 @@ sub macro_get_names { # } # end level 1 -#<<< do not let perltidy touch this +#<<< do not let perltidy touch this unless -nfs is set my @list = (1, 1, 1, 1, 2, 1, @@ -62,6 +62,14 @@ sub macro_get_names { # 1, 4, 6, 4, 1,); #>>> +#<< test alternate format skipping string + my @list = (1, + 1, 1, + 1, 2, 1, + 1, 3, 3, 1, + 1, 4, 6, 4, 1,); +#>> + # some blank lines follow @@ -80,7 +88,7 @@ __END__ =pod -Some pod after __END__ to delete with -dp +Some pod after __END__ to delete with -dp and trim with -trp =cut diff --git a/t/snippets/expect/comments.comments5 b/t/snippets/expect/comments.comments5 index 04efd9c1..158df431 100644 --- a/t/snippets/expect/comments.comments5 +++ b/t/snippets/expect/comments.comments5 @@ -46,7 +46,7 @@ sub macro_get_names { } } -#<<< do not let perltidy touch this +#<<< do not let perltidy touch this unless -nfs is set my @list = (1, 1, 1, 1, 2, 1, @@ -54,6 +54,11 @@ sub macro_get_names { 1, 4, 6, 4, 1,); #>>> +#<< test alternate format skipping string +my @list = ( 1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 6, 4, 1, ); + +#>> + # some blank lines follow =pod @@ -67,7 +72,7 @@ __END__ =pod -Some pod after __END__ to delete with -dp +Some pod after __END__ to delete with -dp and trim with -trp =cut diff --git a/t/snippets/expect/comments.def b/t/snippets/expect/comments.def index 177ce345..2bfe03ec 100644 --- a/t/snippets/expect/comments.def +++ b/t/snippets/expect/comments.def @@ -50,7 +50,7 @@ sub macro_get_names { # } # end level 2 } # end level 1 -#<<< do not let perltidy touch this +#<<< do not let perltidy touch this unless -nfs is set my @list = (1, 1, 1, 1, 2, 1, @@ -58,6 +58,11 @@ sub macro_get_names { # 1, 4, 6, 4, 1,); #>>> +#<< test alternate format skipping string +my @list = ( 1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 6, 4, 1, ); + +#>> + # some blank lines follow =pod @@ -71,7 +76,7 @@ __END__ =pod -Some pod after __END__ to delete with -dp +Some pod after __END__ to delete with -dp and trim with -trp =cut diff --git a/t/snippets/packing_list.txt b/t/snippets/packing_list.txt index aff810f5..05147032 100644 --- a/t/snippets/packing_list.txt +++ b/t/snippets/packing_list.txt @@ -211,6 +211,7 @@ ../snippets19.t space_paren.space_paren2 ../snippets19.t braces.braces5 ../snippets19.t braces.braces6 +../snippets19.t maths.maths3 ../snippets2.t angle.def ../snippets2.t arrows1.def ../snippets2.t arrows2.def @@ -371,4 +372,3 @@ ../snippets9.t rt98902.def ../snippets9.t rt98902.rt98902 ../snippets9.t rt99961.def -../snippets19.t maths.maths3 diff --git a/t/snippets17.t b/t/snippets17.t index 108c0738..19e4a3d5 100644 --- a/t/snippets17.t +++ b/t/snippets17.t @@ -44,21 +44,23 @@ BEGIN { # --noindent-block-comments, # --nohanging-side-comments # --static-side-comments --fpsc=40 -iscl -nibc -nhsc -ssc +# --trim-pod +-fpsc=40 -iscl -nibc -nhsc -ssc -trp ---------- 'comments2' => <<'----------', # testing --minimum-space-to-comment=10, --delete-block-comments, --delete-pod -msc=10 -dbc -dp ---------- 'comments3' => <<'----------', -# testing --maximum-consecutive-blank-lines=2 and --indent-spaced-block-comments --mbl=2 -isbc +# testing --maximum-consecutive-blank-lines=2 and --indent-spaced-block-comments --no-format-skipping +-mbl=2 -isbc -nfs ---------- 'comments4' => <<'----------', # testing --keep-old-blank-lines=2 [=all] and # --nooutdent-long-comments and # --outdent-static-block-comments --kbl=2 -nolc -osbc +# --format-skipping-begin and --format-skipping-end +-kbl=2 -nolc -osbc -fsb='#<{2,}' -fse='#>{2,}' ---------- 'def' => "", 'long_line' => "-l=0", @@ -133,7 +135,7 @@ sub macro_get_names { # } # end level 1 -#<<< do not let perltidy touch this +#<<< do not let perltidy touch this unless -nfs is set my @list = (1, 1, 1, 1, 2, 1, @@ -141,6 +143,14 @@ sub macro_get_names { # 1, 4, 6, 4, 1,); #>>> +#<< test alternate format skipping string + my @list = (1, + 1, 1, + 1, 2, 1, + 1, 3, 3, 1, + 1, 4, 6, 4, 1,); +#>> + # some blank lines follow @@ -159,7 +169,7 @@ __END__ =pod -Some pod after __END__ to delete with -dp +Some pod after __END__ to delete with -dp and trim with -trp =cut @@ -350,7 +360,7 @@ sub macro_get_names { # } # end level 2 } # end level 1 -#<<< do not let perltidy touch this +#<<< do not let perltidy touch this unless -nfs is set my @list = (1, 1, 1, 1, 2, 1, @@ -358,6 +368,11 @@ sub macro_get_names { # 1, 4, 6, 4, 1,); #>>> +#<< test alternate format skipping string +my @list = ( 1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 6, 4, 1, ); + +#>> + # some blank lines follow =pod @@ -371,7 +386,7 @@ __END__ =pod -Some pod after __END__ to delete with -dp +Some pod after __END__ to delete with -dp and trim with -trp =cut @@ -421,7 +436,7 @@ sub macro_get_names { # } # end level 2 } # end level 1 -#<<< do not let perltidy touch this +#<<< do not let perltidy touch this unless -nfs is set my @list = (1, 1, 1, 1, 2, 1, @@ -429,6 +444,8 @@ sub macro_get_names { # 1, 4, 6, 4, 1,); #>>> +my @list = ( 1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 6, 4, 1, ); + __END__ @@ -500,14 +517,16 @@ sub macro_get_names { # } # end level 1 -#<<< do not let perltidy touch this - my @list = (1, - 1, 1, - 1, 2, 1, - 1, 3, 3, 1, - 1, 4, 6, 4, 1,); +#<<< do not let perltidy touch this unless -nfs is set +my @list = ( 1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 6, 4, 1, ); + #>>> +#<< test alternate format skipping string +my @list = ( 1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 6, 4, 1, ); + +#>> + # some blank lines follow @@ -524,7 +543,7 @@ __END__ =pod -Some pod after __END__ to delete with -dp +Some pod after __END__ to delete with -dp and trim with -trp =cut @@ -591,7 +610,7 @@ sub macro_get_names { # } # end level 1 -#<<< do not let perltidy touch this +#<<< do not let perltidy touch this unless -nfs is set my @list = (1, 1, 1, 1, 2, 1, @@ -599,6 +618,14 @@ sub macro_get_names { # 1, 4, 6, 4, 1,); #>>> +#<< test alternate format skipping string + my @list = (1, + 1, 1, + 1, 2, 1, + 1, 3, 3, 1, + 1, 4, 6, 4, 1,); +#>> + # some blank lines follow @@ -617,7 +644,7 @@ __END__ =pod -Some pod after __END__ to delete with -dp +Some pod after __END__ to delete with -dp and trim with -trp =cut @@ -680,7 +707,7 @@ sub macro_get_names { # } # end level 2 } # end level 1 -#<<< do not let perltidy touch this +#<<< do not let perltidy touch this unless -nfs is set my @list = (1, 1, 1, 1, 2, 1, @@ -688,6 +715,11 @@ sub macro_get_names { # 1, 4, 6, 4, 1,); #>>> +#<< test alternate format skipping string +my @list = ( 1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 6, 4, 1, ); + +#>> + # some blank lines follow =pod @@ -701,7 +733,7 @@ __END__ =pod -Some pod after __END__ to delete with -dp +Some pod after __END__ to delete with -dp and trim with -trp =cut diff --git a/t/snippets18.t b/t/snippets18.t index 29984b65..f8554385 100644 --- a/t/snippets18.t +++ b/t/snippets18.t @@ -129,7 +129,7 @@ sub macro_get_names { # } # end level 1 -#<<< do not let perltidy touch this +#<<< do not let perltidy touch this unless -nfs is set my @list = (1, 1, 1, 1, 2, 1, @@ -137,6 +137,14 @@ sub macro_get_names { # 1, 4, 6, 4, 1,); #>>> +#<< test alternate format skipping string + my @list = (1, + 1, 1, + 1, 2, 1, + 1, 3, 3, 1, + 1, 4, 6, 4, 1,); +#>> + # some blank lines follow @@ -155,7 +163,7 @@ __END__ =pod -Some pod after __END__ to delete with -dp +Some pod after __END__ to delete with -dp and trim with -trp =cut @@ -359,7 +367,7 @@ sub macro_get_names { } } -#<<< do not let perltidy touch this +#<<< do not let perltidy touch this unless -nfs is set my @list = (1, 1, 1, 1, 2, 1, @@ -367,6 +375,11 @@ sub macro_get_names { 1, 4, 6, 4, 1,); #>>> +#<< test alternate format skipping string +my @list = ( 1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 6, 4, 1, ); + +#>> + # some blank lines follow =pod @@ -380,7 +393,7 @@ __END__ =pod -Some pod after __END__ to delete with -dp +Some pod after __END__ to delete with -dp and trim with -trp =cut -- 2.39.5