Skip to contentSkip to conversation

A couple of fixes for maintainers_include.py

PATCH New Mauro Carvalho Chehab 1 participant 3 messages Jul 12

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover A couple of fixes for maintainers_include.py

Hi Jon,

It follows a couple fixes for maintainers_include when generating maintainer's profile entries.

Regards,
Mauro

Mauro Carvalho Chehab (2):
docs: maintainers_include: don't output duplicated profile entries
docs: maintainers_include.py: output subsystem name if available

 Documentation/sphinx/maintainers_include.py | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
Signature · 1 line
2.55.0
#1 lore raw

PATCH 1/2 docs: maintainers_include: don't output duplicated profile entries

Add a logic to prevent having duplicated maintainer's profile entries at the rst output.

---
 Documentation/sphinx/maintainers_include.py | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
Documentation/sphinx/maintainers_include.py +12 -4
index dc9f9e188ffa..7df73f66e13c 100755
@@ -336,16 +336,24 @@ class MaintainersProfile(Include):
         # Produce a list with all maintainer profiles, sorted by subsystem name
         #
         output = ""
-        for profile, entry in sorted(maint_parser.profile_entries.items()):
+        entries = set()
+        for profile, entry in maint_parser.profile_entries.items():
             name = profile.title()
 
             if entry.startswith("http"):
-                output += f"- `{name} <{entry}>`_\n"
+                new_entry = f"- `{name} <{entry}>`_\n"
             elif entry.startswith("`"):
-                output += f"- {name}: {entry}\n"
+                new_entry = f"- {name}: {entry}\n"
                 self.warning(f"{profile}: Invalid 'P' tag: {entry}\n")
             else:
-                output += f"- {entry}\n"
+                new_entry = f"- {entry}\n"
+
+            if new_entry not in entries:
+                entries.add(new_entry)
+
+        for entry in sorted(entries):
+            output += entry
+
 
         #
         # Create a hidden TOC table with all profiles. That allows adding
Signature · 1 line
2.55.0
#2 lore raw

PATCH 2/2 docs: maintainers_include.py: output subsystem name if available

In reply to Mauro Carvalho Chehab

If the subsystem name is available (which should always be true, except if the parser has an issue), outputs the subsystem's name at the profile entry.

---
 Documentation/sphinx/maintainers_include.py | 2 ++
 1 file changed, 2 insertions(+)
Documentation/sphinx/maintainers_include.py +2 -0
index 7df73f66e13c..1596630a74ca 100755
@@ -345,6 +345,8 @@ class MaintainersProfile(Include):
             elif entry.startswith("`"):
                 new_entry = f"- {name}: {entry}\n"
                 self.warning(f"{profile}: Invalid 'P' tag: {entry}\n")
+            elif name:
+                new_entry = f"- {name}: {entry}\n"
             else:
                 new_entry = f"- {entry}\n"
 
Signature · 1 line
2.55.0