git/t/chainlint
Eric Sunshine c2c29cc03e chainlint: match arbitrary here-docs tags rather than hard-coded names
chainlint.sed swallows top-level here-docs to avoid being fooled by
content which might look like start-of-subshell. It likewise swallows
here-docs in subshells to avoid marking content lines as breaking the
&&-chain, and to avoid being fooled by content which might look like
end-of-subshell, start-of-nested-subshell, or other specially-recognized
constructs.

At the time of implementation, it was believed that it was not possible
to support arbitrary here-doc tag names since 'sed' provides no way to
stash the opening tag name in a variable for later comparison against a
line signaling end-of-here-doc. Consequently, tag names are hard-coded,
with "EOF" being the only tag recognized at the top-level, and only
"EOF", "EOT", and "INPUT_END" being recognized within subshells. Also,
special care was taken to avoid being confused by here-docs nested
within other here-docs.

In practice, this limited number of hard-coded tag names has been "good
enough" for the 13000+ existing Git test, despite many of those tests
using tags other than the recognized ones, since the bodies of those
here-docs do not contain content which would fool the linter.
Nevertheless, the situation is not ideal since someone writing new
tests, and choosing a name not in the "blessed" set could potentially
trigger a false-positive.

To address this shortcoming, upgrade chainlint.sed to handle arbitrary
here-doc tag names, both at the top-level and within subshells.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-13 12:22:11 -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.expect chainlint: match arbitrary here-docs tags rather than hard-coded names 2018-08-13 12:22:11 -07:00
here-doc.test chainlint: match arbitrary here-docs tags rather than hard-coded names 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 t/chainlint: add chainlint "nested subshell" test cases 2018-07-17 09:15:14 -07:00
multi-line-nested-command-substitution.test t/chainlint: add chainlint "nested subshell" test cases 2018-07-17 09:15:14 -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 arbitrary here-docs tags rather than hard-coded names 2018-08-13 12:22:11 -07:00
subshell-here-doc.test chainlint: match arbitrary here-docs tags rather than hard-coded names 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