From: Mauro Carvalho Chehab Date: Sat, 9 May 2026 06:56:40 +0000 (+0200) Subject: docs: maintainers_include: properly handle file patterns X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=083f0b10f540ae16009a26cd441d7dc6f94e1c13;p=thirdparty%2Fkernel%2Flinux.git docs: maintainers_include: properly handle file patterns 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 Fixes: 420849332f9f ("get_maintainer: add ** glob pattern support") Signed-off-by: Mauro Carvalho Chehab Message-ID: <89127706fb3493d00ecb21e528c8a27081e5ed40.1777987027.git.mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet Message-ID: --- diff --git a/Documentation/sphinx/maintainers_include.py b/Documentation/sphinx/maintainers_include.py index ed9cd7b3dc666..5361774b61bc4 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 - 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: