A couple of fixes for maintainers_include.py
Subsystems (2)
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
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.
Reported-by Manuel Ebner <[email protected]>
Signed-off-by Mauro Carvalho Chehab <[email protected]>
--- Documentation/sphinx/maintainers_include.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
Documentation/sphinx/maintainers_include.py +12 -4
@@ -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
PATCH 2/2 docs: maintainers_include.py: output subsystem name if available
In reply to Mauro Carvalho ChehabIf 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.
Signed-off-by Mauro Carvalho Chehab <[email protected]>
--- Documentation/sphinx/maintainers_include.py | 2 ++ 1 file changed, 2 insertions(+)
Documentation/sphinx/maintainers_include.py +2 -0
@@ -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