diff mbox series

[v2,10/9] t/.gitattributes: ignore whitespace in chainlint expect files

Message ID 20240710084704.GA2061142@coredump.intra.peff.net (mailing list archive)
State Accepted
Commit 55fe61559e8ef9e99274d9e649b0fac627a34ba9
Headers show
Series here-doc test bodies (now with 100% more chainlinting) | expand

Commit Message

Jeff King July 10, 2024, 8:47 a.m. UTC
On Wed, Jul 10, 2024 at 04:34:17AM -0400, Jeff King wrote:

>   [5/9]: chainlint.pl: check line numbers in expected output

I just noticed that this one throws off a bunch of whitespace errors
when you apply it. We might want this on top of the series:

-- >8 --
Subject: t/.gitattributes: ignore whitespace in chainlint expect files

The ".expect" files in t/chainlint/ are snippets of expected output from
the chainlint script, and do not necessarily conform to our usual code
style. Especially with the recent change to retain line numbers, blank
lines in the input script end up with trailing whitespace as we print
"3 " for line 3, for example. The point of these files is to match the
output verbatim, so let's not complain about the trailing spaces.

Signed-off-by: Jeff King <peff@peff.net>
---
 t/.gitattributes | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Junio C Hamano July 10, 2024, 5:15 p.m. UTC | #1
Jeff King <peff@peff.net> writes:

> On Wed, Jul 10, 2024 at 04:34:17AM -0400, Jeff King wrote:
>
>>   [5/9]: chainlint.pl: check line numbers in expected output
>
> I just noticed that this one throws off a bunch of whitespace errors
> when you apply it. We might want this on top of the series:

Or at the bottom ;-)  I do agree with the reasoning.

Thanks.

> -- >8 --
> Subject: t/.gitattributes: ignore whitespace in chainlint expect files
>
> The ".expect" files in t/chainlint/ are snippets of expected output from
> the chainlint script, and do not necessarily conform to our usual code
> style. Especially with the recent change to retain line numbers, blank
> lines in the input script end up with trailing whitespace as we print
> "3 " for line 3, for example. The point of these files is to match the
> output verbatim, so let's not complain about the trailing spaces.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
>  t/.gitattributes | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/.gitattributes b/t/.gitattributes
> index b9cea1795d..7664c6e027 100644
> --- a/t/.gitattributes
> +++ b/t/.gitattributes
> @@ -1,5 +1,5 @@
>  t[0-9][0-9][0-9][0-9]/* -whitespace
> -/chainlint/*.expect eol=lf
> +/chainlint/*.expect eol=lf -whitespace
>  /t0110/url-* binary
>  /t3206/* eol=lf
>  /t3900/*.txt eol=lf
diff mbox series

Patch

diff --git a/t/.gitattributes b/t/.gitattributes
index b9cea1795d..7664c6e027 100644
--- a/t/.gitattributes
+++ b/t/.gitattributes
@@ -1,5 +1,5 @@ 
 t[0-9][0-9][0-9][0-9]/* -whitespace
-/chainlint/*.expect eol=lf
+/chainlint/*.expect eol=lf -whitespace
 /t0110/url-* binary
 /t3206/* eol=lf
 /t3900/*.txt eol=lf