git/t/chainlint
Eric Sunshine d93871143f chainlint: let here-doc and multi-line string commence on same line
After swallowing a here-doc, chainlint.sed assumes that no other
processing needs to be done on the line aside from checking for &&-chain
breakage; likewise, after folding a multi-line quoted string. However,
it's conceivable (even if unlikely in practice) that both a here-doc and
a multi-line quoted string might commence on the same line:

    cat <<\EOF && echo "foo
    bar"
    data
    EOF

Support this case by sending the line (after swallowing and folding)
through the normal processing sequence rather than jumping directly to
the check for broken &&-chain.

This change also allows other somewhat pathological cases to be handled,
such as closing a subshell on the same line starting a here-doc:

    (
        cat <<-\INPUT)
        data
        INPUT

or, for instance, opening a multi-line $(...) expression on the same
line starting a here-doc:

    x=$(cat <<-\END &&
        data
        END
        echo "x")

among others.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-13 12:22:12 -07:00
..
arithmetic-expansion.expect
arithmetic-expansion.test
bash-array.expect t/chainlint: add chainlint "specialized" test cases 2018-07-17 09:15:15 -07:00
bash-array.test t/chainlint: add chainlint "specialized" test cases 2018-07-17 09:15:15 -07:00
blank-line.expect
blank-line.test
block.expect t/chainlint: add chainlint "nested subshell" test cases 2018-07-17 09:15:14 -07:00
block.test t/chainlint: add chainlint "nested subshell" test cases 2018-07-17 09:15:14 -07:00
broken-chain.expect
broken-chain.test
case.expect t/chainlint: add chainlint "loop" and "conditional" test cases 2018-07-17 09:15:14 -07:00
case.test t/chainlint: add chainlint "loop" and "conditional" test cases 2018-07-17 09:15:14 -07:00
close-nested-and-parent-together.expect t/chainlint: add chainlint "complex" test cases 2018-07-17 09:15:15 -07:00
close-nested-and-parent-together.test t/chainlint: add chainlint "complex" test cases 2018-07-17 09:15:15 -07:00
close-subshell.expect
close-subshell.test
command-substitution.expect
command-substitution.test
comment.expect
comment.test
complex-if-in-cuddled-loop.expect t/chainlint: add chainlint "complex" test cases 2018-07-17 09:15:15 -07:00
complex-if-in-cuddled-loop.test t/chainlint: add chainlint "complex" test cases 2018-07-17 09:15:15 -07:00
cuddled-if-then-else.expect t/chainlint: add chainlint "cuddled" test cases 2018-07-17 09:15:14 -07:00
cuddled-if-then-else.test t/chainlint: add chainlint "cuddled" test cases 2018-07-17 09:15:14 -07:00
cuddled-loop.expect t/chainlint: add chainlint "cuddled" test cases 2018-07-17 09:15:14 -07:00
cuddled-loop.test t/chainlint: add chainlint "cuddled" test cases 2018-07-17 09:15:14 -07:00
cuddled.expect t/chainlint: add chainlint "cuddled" test cases 2018-07-17 09:15:14 -07:00
cuddled.test t/chainlint: add chainlint "cuddled" test cases 2018-07-17 09:15:14 -07:00
exit-loop.expect t/chainlint: add chainlint "loop" and "conditional" test cases 2018-07-17 09:15:14 -07:00
exit-loop.test t/chainlint: add chainlint "loop" and "conditional" test cases 2018-07-17 09:15:14 -07:00
exit-subshell.expect
exit-subshell.test
for-loop.expect t/chainlint: add chainlint "loop" and "conditional" test cases 2018-07-17 09:15:14 -07:00
for-loop.test t/chainlint: add chainlint "loop" and "conditional" test cases 2018-07-17 09:15:14 -07:00
here-doc-close-subshell.expect chainlint: let here-doc and multi-line string commence on same line 2018-08-13 12:22:12 -07:00
here-doc-close-subshell.test chainlint: let here-doc and multi-line string commence on same line 2018-08-13 12:22:12 -07:00
here-doc-multi-line-command-subst.expect chainlint: let here-doc and multi-line string commence on same line 2018-08-13 12:22:12 -07:00
here-doc-multi-line-command-subst.test chainlint: let here-doc and multi-line string commence on same line 2018-08-13 12:22:12 -07:00
here-doc-multi-line-string.expect chainlint: let here-doc and multi-line string commence on same line 2018-08-13 12:22:12 -07:00
here-doc-multi-line-string.test chainlint: let here-doc and multi-line string commence on same line 2018-08-13 12:22:12 -07:00
here-doc.expect chainlint: match 'quoted' here-doc tags 2018-08-13 12:22:11 -07:00
here-doc.test chainlint: match 'quoted' here-doc tags 2018-08-13 12:22:11 -07:00
if-in-loop.expect t/chainlint: add chainlint "complex" test cases 2018-07-17 09:15:15 -07:00
if-in-loop.test t/chainlint: add chainlint "complex" test cases 2018-07-17 09:15:15 -07:00
if-then-else.expect t/chainlint: add chainlint "loop" and "conditional" test cases 2018-07-17 09:15:14 -07:00
if-then-else.test t/chainlint: add chainlint "loop" and "conditional" test cases 2018-07-17 09:15:14 -07:00
incomplete-line.expect
incomplete-line.test
inline-comment.expect
inline-comment.test
loop-in-if.expect t/chainlint: add chainlint "complex" test cases 2018-07-17 09:15:15 -07:00
loop-in-if.test t/chainlint: add chainlint "complex" test cases 2018-07-17 09:15:15 -07:00
multi-line-nested-command-substitution.expect chainlint: recognize multi-line $(...) when command cuddled with "$(" 2018-08-13 12:22:11 -07:00
multi-line-nested-command-substitution.test chainlint: recognize multi-line $(...) when command cuddled with "$(" 2018-08-13 12:22:11 -07:00
multi-line-string.expect
multi-line-string.test
negated-one-liner.expect t/chainlint: add chainlint "one-liner" test cases 2018-07-17 09:15:14 -07:00
negated-one-liner.test t/chainlint: add chainlint "one-liner" test cases 2018-07-17 09:15:14 -07:00
nested-cuddled-subshell.expect t/chainlint: add chainlint "nested subshell" test cases 2018-07-17 09:15:14 -07:00
nested-cuddled-subshell.test t/chainlint: add chainlint "nested subshell" test cases 2018-07-17 09:15:14 -07:00
nested-here-doc.expect chainlint: match arbitrary here-docs tags rather than hard-coded names 2018-08-13 12:22:11 -07:00
nested-here-doc.test chainlint: match arbitrary here-docs tags rather than hard-coded names 2018-08-13 12:22:11 -07:00
nested-subshell-comment.expect t/chainlint: add chainlint "nested subshell" test cases 2018-07-17 09:15:14 -07:00
nested-subshell-comment.test t/chainlint: add chainlint "nested subshell" test cases 2018-07-17 09:15:14 -07:00
nested-subshell.expect t/chainlint: add chainlint "nested subshell" test cases 2018-07-17 09:15:14 -07:00
nested-subshell.test t/chainlint: add chainlint "nested subshell" test cases 2018-07-17 09:15:14 -07:00
one-liner.expect t/chainlint: add chainlint "one-liner" test cases 2018-07-17 09:15:14 -07:00
one-liner.test t/chainlint: add chainlint "one-liner" test cases 2018-07-17 09:15:14 -07:00
p4-filespec.expect t/chainlint: add chainlint "specialized" test cases 2018-07-17 09:15:15 -07:00
p4-filespec.test t/chainlint: add chainlint "specialized" test cases 2018-07-17 09:15:15 -07:00
pipe.expect
pipe.test
semicolon.expect
semicolon.test
subshell-here-doc.expect chainlint: match 'quoted' here-doc tags 2018-08-13 12:22:11 -07:00
subshell-here-doc.test chainlint: match 'quoted' here-doc tags 2018-08-13 12:22:11 -07:00
subshell-one-liner.expect t/chainlint: add chainlint "one-liner" test cases 2018-07-17 09:15:14 -07:00
subshell-one-liner.test t/chainlint: add chainlint "one-liner" test cases 2018-07-17 09:15:14 -07:00
while-loop.expect t/chainlint: add chainlint "loop" and "conditional" test cases 2018-07-17 09:15:14 -07:00
while-loop.test t/chainlint: add chainlint "loop" and "conditional" test cases 2018-07-17 09:15:14 -07:00