forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 153
Introduce more doc linting #1945
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jnavila
wants to merge
6
commits into
gitgitgadget:master
Choose a base branch
from
jnavila:doc_linting
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e79bd6a
doc: test linkgit macros for well-formedness
jnavila 322df2d
doc: check well-formedness of delimited sections
jnavila 4e01782
doc: check for absence of multiple terms in each entry of desc list
jnavila 2b43e19
doc: check for absence of the form --[no-]parameter
jnavila c32e74f
doc:git-for-each-ref: fix styling and typos
jnavila 8ec969f
doc lint: check that synopsis manpages have synopsis inlines
jnavila File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -497,9 +497,26 @@ $(LINT_DOCS_FSCK_MSGIDS): ../fsck.h fsck-msgids.adoc | |
$(call mkdir_p_parent_template) | ||
$(QUIET_GEN)$(PERL_PATH) lint-fsck-msgids.perl \ | ||
../fsck.h fsck-msgids.adoc $@ | ||
|
||
lint-docs-fsck-msgids: $(LINT_DOCS_FSCK_MSGIDS) | ||
|
||
## Lint: delimited sections | ||
LINT_DOCS_DELIMITED_SECTIONS = $(patsubst %.adoc,.build/lint-docs/delimited-sections/%.ok,$(MAN_TXT)) | ||
$(LINT_DOCS_DELIMITED_SECTIONS): lint-delimited-sections.perl | ||
$(LINT_DOCS_DELIMITED_SECTIONS): .build/lint-docs/delimited-sections/%.ok: %.adoc | ||
$(call mkdir_p_parent_template) | ||
$(QUIET_LINT_DELIMSEC)$(PERL_PATH) lint-delimited-sections.perl $< >$@ | ||
.PHONY: lint-docs-delimited-sections | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Collin Funk wrote (reply to this): Hi,
"Jean-Noël Avila via GitGitGadget" <[email protected]> writes:
> From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <[email protected]>
>
> Due to portability issues, the script generate-configlist.sh was fixed to
> not use carriage returns in the output. However, the result is that it no
> longer correctly handles multiple terms in a single entry of the definition
> list.
>
> We now check that these entries do not exist in the documentation.
>
> Signed-off-by: Jean-Noël Avila <[email protected]>
> ---
> Documentation/Makefile | 10 +++++++++
> Documentation/git-check-attr.adoc | 3 ++-
> Documentation/git-check-ignore.adoc | 9 +++++---
> Documentation/git-http-fetch.adoc | 4 +++-
> Documentation/lint-documentation-style.perl | 24 +++++++++++++++++++++
> Documentation/technical/api-path-walk.adoc | 5 ++++-
> shared.mak | 1 +
> 7 files changed, 50 insertions(+), 6 deletions(-)
> create mode 100755 Documentation/lint-documentation-style.perl
I documented that this was the correct way to format them in
CodingGuidelines. At the time I commented that there were some places
that didn't follow this rule. Junio replied [1]:
> We are updating them gradually while avoiding collisions with
> patches that do other "real" work; see many recent patches to
> Documentation/config/ area by Jean-Noël Avila for more, e.g.
> d30c5cc4 (doc: convert git-mergetool options to new synopsis style,
> 2025-05-25).
As long as he is okay with the change, this looks good to me. It isn't
that many changes, so hopefully it is. :)
Small nit, but the issue was '\n' not being interpreted as a newline in
sed's s command. Mentioning carriage return makes me think of '\r'.
Reviewed-by: Collin Funk <[email protected]>
Collin There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Jean-Noël AVILA wrote (reply to this): On Wednesday, 6 August 2025 03:02:04 CEST Collin Funk wrote:
> Hi,
>
> "Jean-Noël Avila via GitGitGadget" <[email protected]> writes:
> > From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <[email protected]>
> >
> > Due to portability issues, the script generate-configlist.sh was fixed to
> > not use carriage returns in the output. However, the result is that it no
> > longer correctly handles multiple terms in a single entry of the
definition
> > list.
> >
> > We now check that these entries do not exist in the documentation.
> >
> > Signed-off-by: Jean-Noël Avila <[email protected]>
> > ---
> >
> > Documentation/Makefile | 10 +++++++++
> > Documentation/git-check-attr.adoc | 3 ++-
> > Documentation/git-check-ignore.adoc | 9 +++++---
> > Documentation/git-http-fetch.adoc | 4 +++-
> > Documentation/lint-documentation-style.perl | 24 +++++++++++++++++++++
> > Documentation/technical/api-path-walk.adoc | 5 ++++-
> > shared.mak | 1 +
> > 7 files changed, 50 insertions(+), 6 deletions(-)
> > create mode 100755 Documentation/lint-documentation-style.perl
>
> I documented that this was the correct way to format them in
> CodingGuidelines. At the time I commented that there were some places
>
> that didn't follow this rule. Junio replied [1]:
> > We are updating them gradually while avoiding collisions with
> > patches that do other "real" work; see many recent patches to
> > Documentation/config/ area by Jean-Noël Avila for more, e.g.
> > d30c5cc4 (doc: convert git-mergetool options to new synopsis style,
> > 2025-05-25).
>
> As long as he is okay with the change, this looks good to me. It isn't
> that many changes, so hopefully it is. :)
>
> Small nit, but the issue was '\n' not being interpreted as a newline in
> sed's s command. Mentioning carriage return makes me think of '\r'.
>
> Reviewed-by: Collin Funk <[email protected]>
>
> Collin
As a matter of fact, the script did not check config description files, but
only root man pages. Will also push this change in the next iteration.
Thanks
Jean-Noël
|
||
lint-docs-delimited-sections: $(LINT_DOCS_DELIMITED_SECTIONS) | ||
|
||
## Lint: Documentation style | ||
LINT_DOCS_DOC_STYLE = $(patsubst %.adoc,.build/lint-docs/doc-style/%.ok,$(DOC_DEP_TXT)) | ||
$(LINT_DOCS_DOC_STYLE): lint-documentation-style.perl | ||
$(LINT_DOCS_DOC_STYLE): .build/lint-docs/doc-style/%.ok: %.adoc | ||
$(call mkdir_p_parent_template) | ||
$(QUIET_LINT_DOCSTYLE)$(PERL_PATH) lint-documentation-style.perl $< >$@ | ||
.PHONY: lint-docs-doc-style | ||
lint-docs-doc-style: $(LINT_DOCS_DOC_STYLE) | ||
|
||
lint-docs-manpages: | ||
$(QUIET_GEN)./lint-manpages.sh | ||
|
||
|
@@ -528,6 +545,8 @@ lint-docs: lint-docs-fsck-msgids | |
lint-docs: lint-docs-gitlink | ||
lint-docs: lint-docs-man-end-blurb | ||
lint-docs: lint-docs-man-section-order | ||
lint-docs: lint-docs-delimited-sections | ||
lint-docs: lint-docs-doc-style | ||
lint-docs: lint-docs-manpages | ||
lint-docs: lint-docs-meson | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,3 +37,4 @@ exec >/var/tmp/1 | |
echo O=$(git describe maint) | ||
O=v1.6.2.3-38-g318b847 | ||
git shortlog --no-merges $O..maint | ||
--- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Ramsay Jones wrote (reply to this):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Jean-Noël AVILA wrote (reply to this):