summaryrefslogtreecommitdiff
path: root/Documentation/lint-documentation-style.perl
diff options
context:
space:
mode:
authorJean-Noël Avila <jn.avila@free.fr>2025-08-11 20:53:17 +0000
committerJunio C Hamano <gitster@pobox.com>2025-08-11 14:16:04 -0700
commited260220948595b1311d4639dbfc20f02c807fac (patch)
treec2e07eac692d2370f47d8b04438fa3a226f7e371 /Documentation/lint-documentation-style.perl
parent63d33eb7f6ba315c3ecdda63295d9f915d184fcd (diff)
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>
Diffstat (limited to 'Documentation/lint-documentation-style.perl')
-rwxr-xr-xDocumentation/lint-documentation-style.perl24
1 files changed, 24 insertions, 0 deletions
diff --git a/Documentation/lint-documentation-style.perl b/Documentation/lint-documentation-style.perl
new file mode 100755
index 0000000000..1f35a6a116
--- /dev/null
+++ b/Documentation/lint-documentation-style.perl
@@ -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;