d00113ec34
Now that chainlint.pl is functional, take advantage of the existing chainlint self-tests to validate its operation. (While at it, stop validating chainlint.sed against the self-tests since it will soon be retired.) Due to chainlint.sed implementation limitations leaking into the self-test "expect" files, a few of them require minor adjustment to make them compatible with chainlint.pl which does not share those limitations. First, because `sed` does not provide any sort of real recursion, chainlint.sed only emulates recursion into subshells, and each level of recursion leads to a multiplicative increase in complexity of the `sed` rules. To avoid substantial complexity, chainlint.sed, therefore, only emulates subshell recursion one level deep. Any subshell deeper than that is passed through as-is, which means that &&-chains are not checked in deeper subshells. chainlint.pl, on the other hand, employs a proper recursive descent parser, thus checks subshells to any depth and correctly flags broken &&-chains in deep subshells. Second, due to sed's line-oriented nature, chainlint.sed, by necessity, folds multi-line quoted strings into a single line. chainlint.pl, on the other hand, employs a proper lexical analyzer which preserves quoted strings as-is, including embedded newlines. Furthermore, the output of chainlint.sed and chainlint.pl do not match precisely in terms of whitespace. However, since the purpose of the self-checks is to verify that the ?!AMP?! annotations are being correctly added, minor whitespace differences are immaterial. For this reason, rather than adjusting whitespace in all existing self-test "expect" files to match the new linter's output, the `check-chainlint` target ignores whitespace differences. Since `diff -w` is not POSIX, `check-chainlint` attempts to employ `git diff -w`, and only falls back to non-POSIX `diff -w` (and `-u`) if `git diff` is not available. 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-comment.expect | ||
block-comment.test | ||
block.expect | ||
block.test | ||
broken-chain.expect | ||
broken-chain.test | ||
case-comment.expect | ||
case-comment.test | ||
case.expect | ||
case.test | ||
chain-break-continue.expect | ||
chain-break-continue.test | ||
chain-break-return-exit.expect | ||
chain-break-return-exit.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-close-subshell.expect | ||
here-doc-close-subshell.test | ||
here-doc-multi-line-command-subst.expect | ||
here-doc-multi-line-command-subst.test | ||
here-doc-multi-line-string.expect | ||
here-doc-multi-line-string.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 | ||
not-heredoc.expect | ||
not-heredoc.test | ||
one-liner.expect | ||
one-liner.test | ||
p4-filespec.expect | ||
p4-filespec.test | ||
pipe.expect | ||
pipe.test | ||
return-loop.expect | ||
return-loop.test | ||
semicolon.expect | ||
semicolon.test | ||
subshell-here-doc.expect | ||
subshell-here-doc.test | ||
subshell-one-liner.expect | ||
subshell-one-liner.test | ||
t7900-subtree.expect | ||
t7900-subtree.test | ||
while-loop.expect | ||
while-loop.test |