doc: check for absence of multiple terms in each entry of desc list

For simplifying automated translation of the documentation, it is better to
only present one term in each entry of a description list of options. This
is because most of these terms can automatically be marked as
notranslatable.

Also, due to portability issues, the script generate-configlist.sh can no
longer insert newlines in the output. However, the result is that it no
longer correctly handles multiple terms in a single entry of definition
lists.

As a result, we now check that these entries do not exist in the
documentation.

Reviewed-by: Collin Funk <collin.funk1@gmail.com>
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jean-Noël Avila
2025-08-11 20:53:17 +00:00
committed by Junio C Hamano
parent 63d33eb7f6
commit ed26022094
7 changed files with 51 additions and 6 deletions

View File

@@ -0,0 +1,24 @@
#!/usr/bin/perl
use strict;
use warnings;
my $exit_code = 0;
sub report {
my ($line, $msg) = @_;
chomp $line;
print STDERR "$ARGV:$.: '$line' $msg\n";
$exit_code = 1;
}
my $synopsis_style = 0;
while (my $line = <>) {
if ($line =~ /^[ \t]*`?[-a-z0-9.]+`?(, `?[-a-z0-9.]+`?)+(::|;;)$/) {
report($line, "multiple parameters in a definition list item");
}
}
exit $exit_code;