git-commit-vandalism/t/chainlint
Eric Sunshine ae0c55abf8 chainlint.pl: allow || echo to signal failure upstream of a pipe
The use of `|| return` (or `|| exit`) to signal failure within a loop
isn't effective when the loop is upstream of a pipe since the pipe
swallows all upstream exit codes and returns only the exit code of the
final command in the pipeline.

To work around this limitation, tests may adopt an alternative strategy
of signaling failure by emitting text which would never be emitted in
the non-failing case. For instance:

    while condition
    do
        command1 &&
        command2 ||
        echo "impossible text"
    done |
    sort >actual &&

Such usage indicates deliberate thought about failure cases by the test
author, thus flagging them as missing `|| return` (or `|| exit`) is not
helpful. Therefore, take this case into consideration when checking for
explicit loop termination.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-09-01 10:07:41 -07:00
..
arithmetic-expansion.expect chainlint.sed: drop subshell-closing ">" annotation 2021-12-13 14:15:29 -08:00
arithmetic-expansion.test
bash-array.expect chainlint.sed: drop subshell-closing ">" annotation 2021-12-13 14:15:29 -08:00
bash-array.test
blank-line.expect chainlint.sed: drop subshell-closing ">" annotation 2021-12-13 14:15:29 -08:00
blank-line.test
block-comment.expect chainlint.sed: swallow comments consistently 2021-12-13 14:15:29 -08:00
block-comment.test chainlint.sed: swallow comments consistently 2021-12-13 14:15:29 -08:00
block.expect t/Makefile: apply chainlint.pl to existing self-tests 2022-09-01 10:07:40 -07:00
block.test
broken-chain.expect chainlint.sed: drop subshell-closing ">" annotation 2021-12-13 14:15:29 -08:00
broken-chain.test
case-comment.expect chainlint.sed: swallow comments consistently 2021-12-13 14:15:29 -08:00
case-comment.test chainlint.sed: swallow comments consistently 2021-12-13 14:15:29 -08:00
case.expect chainlint.sed: drop subshell-closing ">" annotation 2021-12-13 14:15:29 -08:00
case.test
chain-break-background.expect chainlint.pl: don't require & background command to end with && 2022-09-01 10:07:40 -07:00
chain-break-background.test chainlint.pl: don't require & background command to end with && 2022-09-01 10:07:40 -07:00
chain-break-continue.expect chainlint.pl: don't require return|exit|continue to end with && 2022-09-01 10:07:40 -07:00
chain-break-continue.test chainlint.pl: don't require return|exit|continue to end with && 2022-09-01 10:07:40 -07:00
chain-break-false.expect chainlint.pl: don't flag broken &&-chain if failure indicated explicitly 2022-09-01 10:07:41 -07:00
chain-break-false.test chainlint.pl: don't flag broken &&-chain if failure indicated explicitly 2022-09-01 10:07:41 -07:00
chain-break-return-exit.expect chainlint.pl: don't flag broken &&-chain if failure indicated explicitly 2022-09-01 10:07:41 -07:00
chain-break-return-exit.test chainlint.pl: don't flag broken &&-chain if failure indicated explicitly 2022-09-01 10:07:41 -07:00
chain-break-status.expect chainlint.pl: don't flag broken &&-chain if $? handled explicitly 2022-09-01 10:07:41 -07:00
chain-break-status.test chainlint.pl: don't flag broken &&-chain if $? handled explicitly 2022-09-01 10:07:41 -07:00
close-nested-and-parent-together.expect chainlint.sed: stop splitting "(..." into separate lines "(" and "..." 2021-12-13 14:15:29 -08:00
close-nested-and-parent-together.test
close-subshell.expect chainlint.sed: drop subshell-closing ">" annotation 2021-12-13 14:15:29 -08:00
close-subshell.test
command-substitution.expect chainlint.sed: drop subshell-closing ">" annotation 2021-12-13 14:15:29 -08:00
command-substitution.test
comment.expect chainlint.sed: drop subshell-closing ">" annotation 2021-12-13 14:15:29 -08:00
comment.test
complex-if-in-cuddled-loop.expect chainlint.pl: complain about loops lacking explicit failure handling 2022-09-01 10:07:41 -07:00
complex-if-in-cuddled-loop.test
cuddled-if-then-else.expect chainlint.sed: stop splitting "(..." into separate lines "(" and "..." 2021-12-13 14:15:29 -08:00
cuddled-if-then-else.test
cuddled-loop.expect chainlint.sed: stop splitting "(..." into separate lines "(" and "..." 2021-12-13 14:15:29 -08:00
cuddled-loop.test t/chainlint/*.test: fix invalid test cases due to mixing quote types 2021-12-13 14:15:28 -08:00
cuddled.expect chainlint.sed: stop splitting "(..." into separate lines "(" and "..." 2021-12-13 14:15:29 -08:00
cuddled.test
exit-loop.expect chainlint.sed: drop subshell-closing ">" annotation 2021-12-13 14:15:29 -08:00
exit-loop.test
exit-subshell.expect chainlint.sed: drop subshell-closing ">" annotation 2021-12-13 14:15:29 -08:00
exit-subshell.test
for-loop.expect chainlint.pl: complain about loops lacking explicit failure handling 2022-09-01 10:07:41 -07:00
for-loop.test
here-doc-close-subshell.expect chainlint.sed: stop throwing away here-doc tags 2021-12-13 14:15:29 -08:00
here-doc-close-subshell.test
here-doc-multi-line-command-subst.expect chainlint.sed: stop throwing away here-doc tags 2021-12-13 14:15:29 -08:00
here-doc-multi-line-command-subst.test
here-doc-multi-line-string.expect t/Makefile: apply chainlint.pl to existing self-tests 2022-09-01 10:07:40 -07:00
here-doc-multi-line-string.test
here-doc.expect chainlint.sed: stop throwing away here-doc tags 2021-12-13 14:15:29 -08:00
here-doc.test
if-in-loop.expect chainlint.pl: don't flag broken &&-chain if failure indicated explicitly 2022-09-01 10:07:41 -07:00
if-in-loop.test chainlint.pl: don't flag broken &&-chain if failure indicated explicitly 2022-09-01 10:07:41 -07:00
if-then-else.expect chainlint.sed: stop throwing away here-doc tags 2021-12-13 14:15:29 -08:00
if-then-else.test
incomplete-line.expect chainlint.sed: drop subshell-closing ">" annotation 2021-12-13 14:15:29 -08:00
incomplete-line.test
inline-comment.expect chainlint.sed: stop splitting "(..." into separate lines "(" and "..." 2021-12-13 14:15:29 -08:00
inline-comment.test
loop-detect-failure.expect chainlint.pl: complain about loops lacking explicit failure handling 2022-09-01 10:07:41 -07:00
loop-detect-failure.test chainlint.pl: complain about loops lacking explicit failure handling 2022-09-01 10:07:41 -07:00
loop-detect-status.expect chainlint.pl: complain about loops lacking explicit failure handling 2022-09-01 10:07:41 -07:00
loop-detect-status.test chainlint.pl: complain about loops lacking explicit failure handling 2022-09-01 10:07:41 -07:00
loop-in-if.expect chainlint.pl: complain about loops lacking explicit failure handling 2022-09-01 10:07:41 -07:00
loop-in-if.test
loop-upstream-pipe.expect chainlint.pl: allow || echo to signal failure upstream of a pipe 2022-09-01 10:07:41 -07:00
loop-upstream-pipe.test chainlint.pl: allow || echo to signal failure upstream of a pipe 2022-09-01 10:07:41 -07:00
multi-line-nested-command-substitution.expect chainlint.sed: drop subshell-closing ">" annotation 2021-12-13 14:15:29 -08:00
multi-line-nested-command-substitution.test
multi-line-string.expect t/Makefile: apply chainlint.pl to existing self-tests 2022-09-01 10:07:40 -07:00
multi-line-string.test
negated-one-liner.expect chainlint.sed: drop unnecessary distinction between ?!AMP?! and ?!SEMI?! 2021-12-13 14:15:29 -08:00
negated-one-liner.test
nested-cuddled-subshell.expect chainlint.sed: drop subshell-closing ">" annotation 2021-12-13 14:15:29 -08:00
nested-cuddled-subshell.test
nested-here-doc.expect chainlint.sed: stop throwing away here-doc tags 2021-12-13 14:15:29 -08:00
nested-here-doc.test
nested-loop-detect-failure.expect chainlint.pl: complain about loops lacking explicit failure handling 2022-09-01 10:07:41 -07:00
nested-loop-detect-failure.test chainlint.pl: complain about loops lacking explicit failure handling 2022-09-01 10:07:41 -07:00
nested-subshell-comment.expect chainlint.sed: swallow comments consistently 2021-12-13 14:15:29 -08:00
nested-subshell-comment.test
nested-subshell.expect t/Makefile: apply chainlint.pl to existing self-tests 2022-09-01 10:07:40 -07:00
nested-subshell.test
not-heredoc.expect chainlint.sed: don't mistake << word in string as here-doc operator 2021-12-13 14:15:29 -08:00
not-heredoc.test chainlint.sed: don't mistake << word in string as here-doc operator 2021-12-13 14:15:29 -08:00
one-liner.expect chainlint.sed: drop unnecessary distinction between ?!AMP?! and ?!SEMI?! 2021-12-13 14:15:29 -08:00
one-liner.test t/chainlint/one-liner: avoid overly intimate chainlint.sed knowledge 2021-12-13 14:15:28 -08:00
p4-filespec.expect chainlint.sed: drop subshell-closing ">" annotation 2021-12-13 14:15:29 -08:00
p4-filespec.test
pipe.expect chainlint.sed: drop subshell-closing ">" annotation 2021-12-13 14:15:29 -08:00
pipe.test
return-loop.expect chainlint.pl: don't require return|exit|continue to end with && 2022-09-01 10:07:40 -07:00
return-loop.test chainlint.pl: don't require return|exit|continue to end with && 2022-09-01 10:07:40 -07:00
semicolon.expect chainlint.pl: complain about loops lacking explicit failure handling 2022-09-01 10:07:41 -07:00
semicolon.test
subshell-here-doc.expect chainlint.sed: stop throwing away here-doc tags 2021-12-13 14:15:29 -08:00
subshell-here-doc.test
subshell-one-liner.expect chainlint.sed: drop subshell-closing ">" annotation 2021-12-13 14:15:29 -08:00
subshell-one-liner.test
t7900-subtree.expect t/Makefile: apply chainlint.pl to existing self-tests 2022-09-01 10:07:40 -07:00
t7900-subtree.test
while-loop.expect chainlint.pl: complain about loops lacking explicit failure handling 2022-09-01 10:07:41 -07:00
while-loop.test