Linux Documentation
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Jonathan Corbet <corbet@lwn.net>,
	Linux Doc Mailing List <linux-doc@vger.kernel.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Joe Perches <joe@perches.com>,
	Matteo Croce <technoboy85@gmail.com>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Matteo Croce <teknoraver@meta.com>
Subject: [PATCH v2 07/11] docs: maintainers_include: properly handle file patterns
Date: Tue,  5 May 2026 15:25:54 +0200	[thread overview]
Message-ID: <89127706fb3493d00ecb21e528c8a27081e5ed40.1777987027.git.mchehab+huawei@kernel.org> (raw)
In-Reply-To: <cover.1777987027.git.mchehab+huawei@kernel.org>

handling asterisks inside file patterns atdescription part is
problematic, as ReST has special meaning for them. Due to
that, convert such patterns to literal strings.

Reported-by: Matteo Croce <teknoraver@meta.com>
Fixes: 420849332f9f ("get_maintainer: add ** glob pattern support")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 Documentation/sphinx/maintainers_include.py | 26 ++++++++++-----------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/Documentation/sphinx/maintainers_include.py b/Documentation/sphinx/maintainers_include.py
index 6f1bcbde90c4..8916d3512e0d 100755
--- a/Documentation/sphinx/maintainers_include.py
+++ b/Documentation/sphinx/maintainers_include.py
@@ -47,9 +47,6 @@ class MaintainersParser:
         self.maintainers = False
         self.subsystems = False
 
-        # Field letter to field name mapping.
-        self.field_letter = None
-
         self.subsystem_name = None
 
         self.app_dir = os.path.abspath(app_dir)
@@ -125,19 +122,22 @@ class MaintainersParser:
             self.header += "\n" + line
             return
 
-        # Escape the escapes in preformatted text.
-        self.header += "| " + self.linkify(line).replace("\\", "\\\\")
-
         # Look for and record field letter to field name mappings:
         #   R: Designated *reviewer*: FullName <address@domain>
-        m = re.search(r"\s(\S):\s", line)
+        m = re.match(r"\s+(\S):\s+(\S+)", line)
         if m:
-            self.field_letter = m.group(1)
+            field = m.group(1)
+            details = m.group(2)
+
+            if field not in self.fields:
+                m = re.search(r"\*([^\*]+)\*", line)
+                if m:
+                    self.fields[field] = m.group(1)
+            elif field in ['F', 'N', 'X', 'K']:
+                line = line.replace(details, f'``{details}``')
+
+        self.header += "| " + self.linkify(line)
 
-        if self.field_letter and self.field_letter not in self.fields:
-            m = re.search(r"\*([^\*]+)\*", line)
-            if m:
-                self.fields[self.field_letter] = m.group(1)
 
     def parse_subsystems(self, line):
         """Handle contents of the per-subsystem sections."""
@@ -206,7 +206,7 @@ class MaintainersParser:
         #
         if field in ['F', 'N', 'X', 'K']:
             # But only if not already marked :)
-            if not ':doc:' in details:
+            if ':doc:' not in details and "http" not in details:
                 details = '``%s``' % (details)
 
         if self.subsystem_name not in self.maint_entries:
-- 
2.54.0


  parent reply	other threads:[~2026-05-05 13:26 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-05 13:25 [PATCH v2 00/11] Improve process/maintainers output Mauro Carvalho Chehab
2026-05-05 13:25 ` [PATCH v2 01/11] docs: maintainers_include: keep hidden TOC sorted Mauro Carvalho Chehab
2026-05-05 13:25 ` [PATCH v2 02/11] docs: maintainers_include: split state machine on multiple funcs Mauro Carvalho Chehab
2026-05-05 13:25 ` [PATCH v2 03/11] docs: maintainers_include: cleanup the code Mauro Carvalho Chehab
2026-05-05 13:25 ` [PATCH v2 04/11] docs: maintainers_include: clean most SPHINXDIRS=process warnings Mauro Carvalho Chehab
2026-05-05 19:53   ` Randy Dunlap
2026-05-08  6:32     ` Mauro Carvalho Chehab
2026-05-05 13:25 ` [PATCH v2 05/11] docs: maintainers_include: do some coding style cleanups Mauro Carvalho Chehab
2026-05-05 13:25 ` [PATCH v2 06/11] docs: maintainers_include: store maintainers entries on a dict Mauro Carvalho Chehab
2026-05-05 13:25 ` Mauro Carvalho Chehab [this message]
2026-05-05 13:25 ` [PATCH v2 08/11] docs: maintainers_include: add a filtering javascript Mauro Carvalho Chehab
2026-05-05 13:25 ` [PATCH v2 09/11] docs: maintainers_include: don't ignore invalid profile entries Mauro Carvalho Chehab
2026-05-05 13:25 ` [PATCH v2 10/11] MAINTAINERS: make clearer about what's expected for "P" field Mauro Carvalho Chehab
2026-05-05 18:02   ` Miguel Ojeda
2026-05-08  6:42     ` Mauro Carvalho Chehab
2026-05-05 13:25 ` [PATCH v2 11/11] MAINTAINERS: use a URL for pin-init maintainer's profile entry Mauro Carvalho Chehab
2026-05-05 13:49   ` Gary Guo
2026-05-05 18:04     ` Miguel Ojeda
2026-05-06  6:49     ` Mauro Carvalho Chehab
2026-05-06  8:38       ` Miguel Ojeda
2026-05-08  7:16         ` Mauro Carvalho Chehab
2026-05-08  9:45           ` Miguel Ojeda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=89127706fb3493d00ecb21e528c8a27081e5ed40.1777987027.git.mchehab+huawei@kernel.org \
    --to=mchehab+huawei@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=joe@perches.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=technoboy85@gmail.com \
    --cc=teknoraver@meta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox