git/t/chainlint
Eric Sunshine e44f15ba3e chainlint: make error messages self-explanatory
The annotations emitted by chainlint to indicate detected problems are
overly terse, so much so that developers new to the project -- those who
should most benefit from the linting -- may find them baffling. For
instance, although the author of chainlint and seasoned Git developers
may understand that "?!AMP?!" is an abbreviation of "ampersand" and
indicates a break in the &&-chain, this may not be obvious to newcomers.

The "?!LOOP?!" case is particularly serious because that terse single
word does nothing to convey that the loop body should end with
"|| return 1" (or "|| exit 1" in a subshell) to ensure that a failing
command in the body aborts the loop immediately. Moreover, unlike
&&-chaining which is ubiquitous in Git tests, the "|| return 1" idiom is
relatively infrequent, thus may be harder for a newcomer to discover by
consulting nearby code.

Address these shortcomings by emitting human-readable messages which
both explain the problem and give a strong hint about how to correct it.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-09-10 10:01:40 -07:00
..
arithmetic-expansion.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
arithmetic-expansion.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
bash-array.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
bash-array.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
blank-line-before-esac.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
blank-line-before-esac.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
blank-line.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
blank-line.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
block-comment.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
block-comment.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
block.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
block.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
broken-chain.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
broken-chain.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
case-comment.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
case-comment.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
case.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
case.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
chain-break-background.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
chain-break-background.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
chain-break-continue.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
chain-break-continue.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
chain-break-false.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
chain-break-false.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
chain-break-return-exit.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
chain-break-return-exit.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
chain-break-status.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
chain-break-status.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
chained-block.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
chained-block.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
chained-subshell.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
chained-subshell.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
close-nested-and-parent-together.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
close-nested-and-parent-together.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
close-subshell.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
close-subshell.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
command-substitution-subsubshell.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
command-substitution-subsubshell.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
command-substitution.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
command-substitution.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
comment.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
comment.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
complex-if-in-cuddled-loop.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
complex-if-in-cuddled-loop.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
cuddled-if-then-else.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
cuddled-if-then-else.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
cuddled-loop.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
cuddled-loop.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
cuddled.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
cuddled.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
double-here-doc.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
double-here-doc.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
dqstring-line-splice.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
dqstring-line-splice.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
dqstring-no-interpolate.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
dqstring-no-interpolate.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
empty-here-doc.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
empty-here-doc.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
exclamation.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
exclamation.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
exit-loop.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
exit-loop.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
exit-subshell.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
exit-subshell.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
for-loop-abbreviated.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
for-loop-abbreviated.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
for-loop.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
for-loop.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
function.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
function.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
here-doc-body-indent.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
here-doc-body-indent.test chainlint.pl: add tests for test body in heredoc 2024-07-10 10:14:22 -07:00
here-doc-body-pathological.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
here-doc-body-pathological.test chainlint.pl: add tests for test body in heredoc 2024-07-10 10:14:22 -07:00
here-doc-body.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
here-doc-body.test chainlint.pl: add tests for test body in heredoc 2024-07-10 10:14:22 -07:00
here-doc-close-subshell.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
here-doc-close-subshell.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
here-doc-double.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
here-doc-double.test chainlint.pl: add tests for test body in heredoc 2024-07-10 10:14:22 -07:00
here-doc-indent-operator.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
here-doc-indent-operator.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
here-doc-multi-line-command-subst.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
here-doc-multi-line-command-subst.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
here-doc-multi-line-string.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
here-doc-multi-line-string.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
here-doc.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
here-doc.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
if-condition-split.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
if-condition-split.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
if-in-loop.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
if-in-loop.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
if-then-else.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
if-then-else.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
incomplete-line.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
incomplete-line.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
inline-comment.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
inline-comment.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
loop-detect-failure.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
loop-detect-failure.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
loop-detect-status.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
loop-detect-status.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
loop-in-if.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
loop-in-if.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
loop-upstream-pipe.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
loop-upstream-pipe.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
multi-line-nested-command-substitution.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
multi-line-nested-command-substitution.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
multi-line-string.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
multi-line-string.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
negated-one-liner.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
negated-one-liner.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
nested-cuddled-subshell.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
nested-cuddled-subshell.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
nested-here-doc.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
nested-here-doc.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
nested-loop-detect-failure.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
nested-loop-detect-failure.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
nested-subshell-comment.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
nested-subshell-comment.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
nested-subshell.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
nested-subshell.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
not-heredoc.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
not-heredoc.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
one-liner-for-loop.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
one-liner-for-loop.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
one-liner.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
one-liner.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
p4-filespec.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
p4-filespec.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
pipe.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
pipe.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
return-loop.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
return-loop.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
semicolon.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
semicolon.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
sqstring-in-sqstring.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
sqstring-in-sqstring.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
subshell-here-doc.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
subshell-here-doc.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
subshell-one-liner.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
subshell-one-liner.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
t7900-subtree.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
t7900-subtree.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
token-pasting.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
token-pasting.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
unclosed-here-doc-indent.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
unclosed-here-doc-indent.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
unclosed-here-doc.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
unclosed-here-doc.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
while-loop.expect chainlint: make error messages self-explanatory 2024-09-10 10:01:40 -07:00
while-loop.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00