git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] tests: adjust whitespace in chainlint expectations

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Dec 14, 2023, 08:44 UTC
Message-ID
<CAPig+cTZmiXdPZEVO-F2UzV9YaP6c7r2MfPTC3QWksJa+rM7VA@mail.gmail.com>
In-Reply-To
<aec86a15c69aa276eee4875fad208ee2fc57635a.1702542564.git.ps@pks.im>
On Thu, Dec 14, 2023 at 3:30 AM Patrick Steinhardt <ps@pks.im> wrote:
Show 22 quoted lines
> [...]
> Instead of improving the detection logic, fix our ".expect" files so
> that we do not need any post-processing anymore. This allows us to drop
> the `-w` flag when diffing so that we can always use diff(1) now.
>
> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---
> diff --git a/t/Makefile b/t/Makefile
> @@ -108,15 +108,7 @@ check-chainlint:
>         } >'$(CHAINLINTTMP_SQ)'/expect && \
>         $(CHAINLINT) --emit-all '$(CHAINLINTTMP_SQ)'/tests | \
>                 sed -e 's/^[1-9][0-9]* //;/^[   ]*$$/d' >'$(CHAINLINTTMP_SQ)'/actual && \
> -       if test -f ../GIT-BUILD-OPTIONS; then \
> -               . ../GIT-BUILD-OPTIONS; \
> -       fi && \
> -       if test -x ../git$$X; then \
> -               DIFFW="../git$$X --no-pager diff -w --no-index"; \
> -       else \
> -               DIFFW="diff -w -u"; \
> -       fi && \
> -       $$DIFFW '$(CHAINLINTTMP_SQ)'/expect '$(CHAINLINTTMP_SQ)'/actual
> +       diff -u '$(CHAINLINTTMP_SQ)'/expect '$(CHAINLINTTMP_SQ)'/actual

This change feels incomplete. Yes, it "corrects" the whitespace, but check-chainlint still applies sed to remove blank lines and strip the line numbers from the beginning of each line. Based upon the commit message, I had expected that all post-processing of the output would have been eliminated and that the "expect" files would exactly mirror the output of the linter.

As mentioned elsewhere[1], I'm not particularly in favor of this approach, though I won't stand in the way of it either.

[1]: https://lore.kernel.org/git/CAPig+cSkuRfkR2D3JqYcbaJqj485nfD9Nq6pM=vXWB5DJenWpA@mail.gmail.com/
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 14 of 21 in “tests: prefer host Git to verify chainlint self-checks”
  1. tests: prefer host Git to verify chainlint self-checksPatrick Steinhardt, Dec 12, 2023
  2. Junio C HamanoDec 12, 2023
  3. Patrick SteinhardtDec 13, 2023
  4. Junio C HamanoDec 13, 2023
  5. Eric SunshineDec 14, 2023
  6. Patrick SteinhardtDec 14, 2023
  7. Eric SunshineDec 14, 2023
  8. Patrick SteinhardtDec 14, 2023
  9. Junio C HamanoDec 14, 2023
  10. Eric SunshineDec 14, 2023
  11. Junio C HamanoDec 14, 2023
  12. Patrick SteinhardtDec 15, 2023
  13. tests: adjust whitespace in chainlint expectationsPatrick Steinhardt, Dec 14, 2023
  14. Eric SunshineDec 14, 2023
  15. tests: adjust whitespace in chainlint expectationsPatrick Steinhardt, Dec 15, 2023
  16. Eric SunshineDec 15, 2023
  17. Patrick SteinhardtDec 15, 2023
  18. Eric SunshineDec 15, 2023
  19. tests: adjust whitespace in chainlint expectationsPatrick Steinhardt, Dec 15, 2023
  20. Eric SunshineDec 15, 2023
  21. Junio C HamanoDec 15, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.