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

Re: [PATCH 4/5] doc lint: fix bugs in, simplify and improve lint script

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 28, 2021, 06:38 UTC
Message-ID
<xmqqv99bn5ov.fsf@gitster.g>
In-Reply-To
<patch-4.6-5c8e8f21495-20210326T103454Z-avarab@gmail.com>
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
>  - Was using File::Find to recursively find *.txt files in
>    Documentation/, let's instead use the Makefile as a source of truth
>    for *.txt files, and pass it down to the script.
OK.
>  - We now don't lint linkgit:* in RelNotes/* or technical/*, which we
>    shouldn't have been doing in the first place anyway.

I understand RelNotes (which I consider is plain text file), but are technical/* documentation forbidden from referring to our manual pages for the commands they talk about?

Show 5 quoted lines
>  - When the doc-diff script was added in beb188e22a (add a script to
>    diff rendered documentation, 2018-08-06) we started sometimes having
>    a "git worktree" under "documentation". This tree contains a full
>    checkout of git.git, as a result the "lint" script would recurse into
>    that, and lint any *.txt file found in that entire repository.
Ouch.
>    In practice the only in-tree "linkgit" outside of the
>    Documentation/ tree is contrib/contacts/git-contacts.txt and
>    contrib/subtree/git-subtree.txt, so this wouldn't emit any errors

Hmm, the nested copy of git has Documentation/ subdirectory of its own, and we do not want to scan it, I think.

That is a problem worth fixing.  Thanks for noticing it.
Show 5 quoted lines
> Now we instead simply trust the Makefile to give us *.txt files, and
> since the Makefile also knows what sections each page should be in we
> don't have to open the files ourselves and try to parse that out. As a
> bonus this will also catch bugs with the section line in the file
> being incorrect.
OK.
Show 22 quoted lines
> diff --git a/Documentation/Makefile b/Documentation/Makefile
> index 7313956d73f..6bfd8c75772 100644
> --- a/Documentation/Makefile
> +++ b/Documentation/Makefile
> @@ -4,6 +4,7 @@ MAN5_TXT =
>  MAN7_TXT =
>  HOWTO_TXT =
>  INCLUDE_TARGETS_TXT =
> +ALL_TXT =
>  TECH_DOCS =
>  ARTICLES =
>  SP_ARTICLES =
> @@ -49,6 +50,13 @@ HOWTO_TXT += $(wildcard howto/*.txt)
>  INCLUDE_TARGETS_TXT += $(wildcard *.txt)
>  INCLUDE_TARGETS_TXT += $(wildcard config/*.txt)
>  
> +# For linting
> +ALL_TXT += $(MAN1_TXT)
> +ALL_TXT += $(MAN5_TXT)
> +ALL_TXT += $(MAN7_TXT)
> +ALL_TXT += $(HOWTO_TXT)
> +ALL_TXT += $(INCLUDE_TARGETS_TXT)

The "INCLUDE_TARGETS_TXT" looks more and more like "all txt sources", which is a superset of MAN1_TXT and its friends.

Listing all of them in ALL_TXT duplicated feels somewhat iffy.
Show 13 quoted lines
>  ifdef MAN_FILTER
>  MAN_TXT = $(filter $(MAN_FILTER),$(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT))
>  else
> @@ -477,7 +485,11 @@ print-man1:
>  	@for i in $(MAN1_TXT); do echo $$i; done
>  
>  lint-docs::
> -	$(QUIET_LINT)$(PERL_PATH) lint-gitlink.perl
> +	$(QUIET_LINT)$(PERL_PATH) lint-gitlink.perl \
> +		--section=1 $(MAN1_TXT) \
> +		--section=5 $(MAN5_TXT) \
> +		--section=7 $(MAN7_TXT)	\
> +		--to-lint $(ALL_TXT)
Previous: Junio C HamanoNext: Jeff King
Message 21 of 32 in “small doc make and lint fixes”
  1. 0/5 small doc make and lint fixesÆvar Arnfjörð Bjarmason, Mar 26, 2021
  2. 1/5 Documentation/Makefile: make $(wildcard howto/*.txt) a varÆvar Arnfjörð Bjarmason, Mar 26, 2021
  3. Junio C HamanoMar 28, 2021
  4. 3/5 doc lint: Perl "strict" and "warnings" in lint-gitlink.perlÆvar Arnfjörð Bjarmason, Mar 26, 2021
  5. Junio C HamanoMar 28, 2021
  6. 2/5 Documentation/Makefile: make $(wildcard <doc deps>) a varÆvar Arnfjörð Bjarmason, Mar 26, 2021
  7. Junio C HamanoMar 28, 2021
  8. 5/5 doc lint: lint and fix missing "GIT" end sectionsÆvar Arnfjörð Bjarmason, Mar 26, 2021
  9. Jeff KingMar 26, 2021
  10. Ævar Arnfjörð BjarmasonMar 26, 2021
  11. Jeff KingMar 27, 2021
  12. Junio C HamanoMar 28, 2021
  13. Junio C HamanoMar 28, 2021
  14. Ævar Arnfjörð BjarmasonApr 9, 2021
  15. Junio C HamanoApr 10, 2021
  16. 4/5 doc lint: fix bugs in, simplify and improve lint scriptÆvar Arnfjörð Bjarmason, Mar 26, 2021
  17. Jeff KingMar 26, 2021
  18. Junio C HamanoMar 28, 2021
  19. Philip OakleyMar 26, 2021
  20. Junio C HamanoMar 28, 2021
  21. Junio C HamanoMar 28, 2021
  22. Jeff KingMar 26, 2021
  23. Ævar Arnfjörð BjarmasonMar 26, 2021
  24. Jeff KingMar 27, 2021
  25. 0/7 doc make and lint fixesÆvar Arnfjörð Bjarmason, Apr 9, 2021
  26. 1/7 Documentation/Makefile: make $(wildcard howto/*.txt) a varÆvar Arnfjörð Bjarmason, Apr 9, 2021
  27. 3/7 doc lint: Perl "strict" and "warnings" in lint-gitlink.perlÆvar Arnfjörð Bjarmason, Apr 9, 2021
  28. 2/7 Documentation/Makefile: make doc.dep dependencies a variable againÆvar Arnfjörð Bjarmason, Apr 9, 2021
  29. 4/7 doc lint: fix bugs in, simplify and improve lint scriptÆvar Arnfjörð Bjarmason, Apr 9, 2021
  30. 6/7 doc lint: lint relative section orderÆvar Arnfjörð Bjarmason, Apr 9, 2021
  31. 5/7 doc lint: lint and fix missing "GIT" end sectionsÆvar Arnfjörð Bjarmason, Apr 9, 2021
  32. 7/7 docs: fix linting issues due to incorrect relative section orderÆvar Arnfjörð Bjarmason, Apr 9, 2021

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.