c2c29cc03e
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> |
||
---|---|---|
.. | ||
arithmetic-expansion.expect | ||
arithmetic-expansion.test | ||
bash-array.expect | ||
bash-array.test | ||
blank-line.expect | ||
blank-line.test | ||
block.expect | ||
block.test | ||
broken-chain.expect | ||
broken-chain.test | ||
case.expect | ||
case.test | ||
close-nested-and-parent-together.expect | ||
close-nested-and-parent-together.test | ||
close-subshell.expect | ||
close-subshell.test | ||
command-substitution.expect | ||
command-substitution.test | ||
comment.expect | ||
comment.test | ||
complex-if-in-cuddled-loop.expect | ||
complex-if-in-cuddled-loop.test | ||
cuddled-if-then-else.expect | ||
cuddled-if-then-else.test | ||
cuddled-loop.expect | ||
cuddled-loop.test | ||
cuddled.expect | ||
cuddled.test | ||
exit-loop.expect | ||
exit-loop.test | ||
exit-subshell.expect | ||
exit-subshell.test | ||
for-loop.expect | ||
for-loop.test | ||
here-doc.expect | ||
here-doc.test | ||
if-in-loop.expect | ||
if-in-loop.test | ||
if-then-else.expect | ||
if-then-else.test | ||
incomplete-line.expect | ||
incomplete-line.test | ||
inline-comment.expect | ||
inline-comment.test | ||
loop-in-if.expect | ||
loop-in-if.test | ||
multi-line-nested-command-substitution.expect | ||
multi-line-nested-command-substitution.test | ||
multi-line-string.expect | ||
multi-line-string.test | ||
negated-one-liner.expect | ||
negated-one-liner.test | ||
nested-cuddled-subshell.expect | ||
nested-cuddled-subshell.test | ||
nested-here-doc.expect | ||
nested-here-doc.test | ||
nested-subshell-comment.expect | ||
nested-subshell-comment.test | ||
nested-subshell.expect | ||
nested-subshell.test | ||
one-liner.expect | ||
one-liner.test | ||
p4-filespec.expect | ||
p4-filespec.test | ||
pipe.expect | ||
pipe.test | ||
semicolon.expect | ||
semicolon.test | ||
subshell-here-doc.expect | ||
subshell-here-doc.test | ||
subshell-one-liner.expect | ||
subshell-one-liner.test | ||
while-loop.expect | ||
while-loop.test |