doc lint: check that synopsis manpages have synopsis inlines

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>

Jean-Noël Avila committed Aug 11, 2025 at 20:53 UTC 84f3d6e11e085a52e561a509f2433208f22c6d3b
3 files changed +17 -11
Documentation/git-checkout.adoc
+1 -1
@@ -334,7 +334,7 @@ include::diff-context-options.adoc[]
334 separated with _NUL_ character and all other characters are taken
335 literally (including newlines and quotes).
336
337 -<branch>::
337 +`<branch>`::
338 Branch to checkout; if it refers to a branch (i.e., a name that,
339 when prepended with "refs/heads/", is a valid ref), then that
340 branch is checked out. Otherwise, if it refers to a valid
Documentation/git-refs.adoc
+10 -10
@@ -20,41 +20,41 @@ This command provides low-level access to refs.
20 COMMANDS
21 --------
22
23 -migrate::
23 +`migrate`::
24 Migrate ref store between different formats.
25
26 -verify::
26 +`verify`::
27 Verify reference database consistency.
28
29 OPTIONS
30 -------
31
32 -The following options are specific to 'git refs migrate':
32 +The following options are specific to `git refs migrate`:
33
34 ---ref-format=<format>::
34 +`--ref-format=<format>`::
35 The ref format to migrate the ref store to. Can be one of:
36 +
37 include::ref-storage-format.adoc[]
38
39 ---dry-run::
39 +`--dry-run`::
40 Perform the migration, but do not modify the repository. The migrated
41 refs will be written into a separate directory that can be inspected
42 separately. The name of the directory will be reported on stdout. This
43 can be used to double check that the migration works as expected before
44 performing the actual migration.
45
46 ---reflog::
47 ---no-reflog::
46 +`--reflog`::
47 +`--no-reflog`::
48 Choose between migrating the reflog data to the new backend,
49 and discarding them. The default is "--reflog", to migrate.
50
51 -The following options are specific to 'git refs verify':
51 +The following options are specific to `git refs verify`:
52
53 ---strict::
53 +`--strict`::
54 Enable stricter error checking. This will cause warnings to be
55 reported as errors. See linkgit:git-fsck[1].
56
57 ---verbose::
57 +`--verbose`::
58 When verifying the reference database consistency, be chatty.
59
60 KNOWN LIMITATIONS
Documentation/lint-documentation-style.perl
+6
@@ -21,6 +21,12 @@ while (my $line = <>) {
21 if ($line =~ /^`?--\[no-\][a-z0-9-]+.*(::|;;)$/) {
22 report($line, "definition list item with a `--[no-]` parameter");
23 }
24 + if ($line =~ /^\[synopsis\]$/) {
25 + $synopsis_style = 1;
26 + }
27 + if (($line =~ /^(-[-a-z].*|<[-a-z0-9]+>(\.{3})?)(::|;;)$/) && ($synopsis_style)) {
28 + report($line, "synopsis style and definition list item not backquoted");
29 + }
30 }
31
32