]> git.ipfire.org Git - thirdparty/git.git/commitdiff
doc lint: check that synopsis manpages have synopsis inlines
authorJean-Noël Avila <jn.avila@free.fr>
Mon, 11 Aug 2025 20:53:20 +0000 (20:53 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 11 Aug 2025 21:16:04 +0000 (14:16 -0700)
When switching manpages to the synopsis style, the description lists of
options need to be switched to inline synopsis for proper formatting. This
is done by enclosing the option name in double backticks, e.g. `--option`.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-checkout.adoc
Documentation/git-refs.adoc
Documentation/lint-documentation-style.perl

index 40e02cfd6562ae939ce3ffd7d8454a2430cf7822..ff1cb29bc1f87ec8a6d8a4d9ba75e82e747c00ca 100644 (file)
@@ -334,7 +334,7 @@ include::diff-context-options.adoc[]
        separated with _NUL_ character and all other characters are taken
        literally (including newlines and quotes).
 
-<branch>::
+`<branch>`::
        Branch to checkout; if it refers to a branch (i.e., a name that,
        when prepended with "refs/heads/", is a valid ref), then that
        branch is checked out. Otherwise, if it refers to a valid
index 4d6dc994f92eb2e8c726fc3543557f89aba3d341..5d26de8acb22aae216ea3e5bf55ec52a636e7c18 100644 (file)
@@ -20,41 +20,41 @@ This command provides low-level access to refs.
 COMMANDS
 --------
 
-migrate::
+`migrate`::
        Migrate ref store between different formats.
 
-verify::
+`verify`::
        Verify reference database consistency.
 
 OPTIONS
 -------
 
-The following options are specific to 'git refs migrate':
+The following options are specific to `git refs migrate`:
 
---ref-format=<format>::
+`--ref-format=<format>`::
        The ref format to migrate the ref store to. Can be one of:
 +
 include::ref-storage-format.adoc[]
 
---dry-run::
+`--dry-run`::
        Perform the migration, but do not modify the repository. The migrated
        refs will be written into a separate directory that can be inspected
        separately. The name of the directory will be reported on stdout. This
        can be used to double check that the migration works as expected before
        performing the actual migration.
 
---reflog::
---no-reflog::
+`--reflog`::
+`--no-reflog`::
        Choose between migrating the reflog data to the new backend,
        and discarding them.  The default is "--reflog", to migrate.
 
-The following options are specific to 'git refs verify':
+The following options are specific to `git refs verify`:
 
---strict::
+`--strict`::
        Enable stricter error checking. This will cause warnings to be
        reported as errors. See linkgit:git-fsck[1].
 
---verbose::
+`--verbose`::
        When verifying the reference database consistency, be chatty.
 
 KNOWN LIMITATIONS
index 11321a151bcaf6965f33d9ddf21007bf6deb06aa..d7ab7322939ebdcc0cf9be58248d930f07935022 100755 (executable)
@@ -21,6 +21,12 @@ while (my $line = <>) {
        if ($line =~ /^`?--\[no-\][a-z0-9-]+.*(::|;;)$/) {
                report($line, "definition list item with a `--[no-]` parameter");
        }
+       if ($line =~ /^\[synopsis\]$/) {
+               $synopsis_style = 1;
+       }
+       if (($line =~ /^(-[-a-z].*|<[-a-z0-9]+>(\.{3})?)(::|;;)$/) && ($synopsis_style)) {
+                       report($line, "synopsis style and definition list item not backquoted");
+       }
 }