1
0
mirror of https://github.com/git/git.git synced 2024-09-24 18:30:46 +02:00
git/t/chainlint
Patrick Steinhardt 647b5e0998 tests: adjust whitespace in chainlint expectations
The "check-chainlint" target runs automatically when running tests and
performs self-checks to verify that the chainlinter itself produces the
expected output. Originally, the chainlinter was implemented via sed,
but the infrastructure has been rewritten in fb41727b7e (t: retire
unused chainlint.sed, 2022-09-01) to use a Perl script instead.

The rewrite caused some slight whitespace changes in the output that are
ultimately not of much importance. In order to be able to assert that
the actual chainlinter errors match our expectations we thus have to
ignore whitespace characters when diffing them. As the `-w` flag is not
in POSIX we try to use `git diff -w --no-index` before we fall back to
`diff -w -u`.

To accomodate for cases where the host system has no Git installation we
use the locally-compiled version of Git. This can result in problems
though when the Git project's repository is using extensions that the
locally-compiled version of Git doesn't understand. It will refuse to
run and thus cause the checks to fail.

Instead of improving the detection logic, fix our ".expect" files so
that we do not need any post-processing at all anymore. This allows us
to drop the `-w` flag when diffing so that we can always use diff(1)
now.

Note that we keep some of the post-processing of `chainlint.pl` output
intact to strip leading line numbers generated by the script. Having
these would cause a rippling effect whenever we add a new test that
sorts into the middle of existing tests and would require us to
renumerate all subsequent lines, which seems rather pointless.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-12-15 08:36:14 -08:00
..
arithmetic-expansion.expect
arithmetic-expansion.test
bash-array.expect
bash-array.test
blank-line-before-esac.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
blank-line-before-esac.test
blank-line.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
blank-line.test
block-comment.expect
block-comment.test
block.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
block.test
broken-chain.expect
broken-chain.test
case-comment.expect
case-comment.test
case.expect
case.test
chain-break-background.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
chain-break-background.test
chain-break-continue.expect
chain-break-continue.test
chain-break-false.expect
chain-break-false.test
chain-break-return-exit.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
chain-break-return-exit.test
chain-break-status.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
chain-break-status.test
chained-block.expect
chained-block.test
chained-subshell.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
chained-subshell.test
close-nested-and-parent-together.expect
close-nested-and-parent-together.test
close-subshell.expect
close-subshell.test
command-substitution-subsubshell.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
command-substitution-subsubshell.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
double-here-doc.expect
double-here-doc.test
dqstring-line-splice.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
dqstring-line-splice.test
dqstring-no-interpolate.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
dqstring-no-interpolate.test
empty-here-doc.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
empty-here-doc.test
exclamation.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
exclamation.test
exit-loop.expect
exit-loop.test
exit-subshell.expect
exit-subshell.test
for-loop-abbreviated.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
for-loop-abbreviated.test
for-loop.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
for-loop.test
function.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
function.test
here-doc-close-subshell.expect
here-doc-close-subshell.test
here-doc-indent-operator.expect
here-doc-indent-operator.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 tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
here-doc.test
if-condition-split.expect
if-condition-split.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-detect-failure.expect
loop-detect-failure.test
loop-detect-status.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
loop-detect-status.test
loop-in-if.expect
loop-in-if.test
loop-upstream-pipe.expect
loop-upstream-pipe.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 tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
nested-cuddled-subshell.test
nested-here-doc.expect
nested-here-doc.test
nested-loop-detect-failure.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
nested-loop-detect-failure.test
nested-subshell-comment.expect
nested-subshell-comment.test
nested-subshell.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
nested-subshell.test
not-heredoc.expect
not-heredoc.test
one-liner-for-loop.expect
one-liner-for-loop.test
one-liner.expect
one-liner.test
p4-filespec.expect
p4-filespec.test
pipe.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
pipe.test
return-loop.expect
return-loop.test
semicolon.expect
semicolon.test
sqstring-in-sqstring.expect
sqstring-in-sqstring.test
subshell-here-doc.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
subshell-here-doc.test
subshell-one-liner.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
subshell-one-liner.test
t7900-subtree.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
t7900-subtree.test
token-pasting.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
token-pasting.test
unclosed-here-doc-indent.expect
unclosed-here-doc-indent.test
unclosed-here-doc.expect
unclosed-here-doc.test
while-loop.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
while-loop.test