From 11af1a275bd646af40c5b009bb6c6c228f18e644 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Fri, 21 Mar 2025 10:26:11 +1300 Subject: [PATCH] Docs: Downgrade missing cmdgroup warning Log an info message, and put a warning for the content instead. --- docs/util/newcmdref.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/util/newcmdref.py b/docs/util/newcmdref.py index 6db7493af..cd6f84da5 100644 --- a/docs/util/newcmdref.py +++ b/docs/util/newcmdref.py @@ -223,11 +223,17 @@ class YosysCmdGroupDocumenter(Documenter): ) return + sourcename = self.get_sourcename() + if not self.import_object(): - logger.warning( - f"unable to load {self.name} with {type(self)}", - type = 'cmdref' - ) + log_msg = f"unable to load {self.name} with {type(self)}" + if self.lib_key == 'groups': + logger.info(log_msg, type = 'cmdref') + self.add_line(f'.. warning:: No commands found for group {self.name!r}', sourcename) + self.add_line('', sourcename) + self.add_line(' Documentation may have been built without ``source_location`` support.', sourcename) + else: + logger.warning(log_msg, type = 'cmdref') return # check __module__ of object (for members not given explicitly) @@ -235,7 +241,6 @@ class YosysCmdGroupDocumenter(Documenter): # if not self.check_module(): # return - sourcename = self.get_sourcename() self.add_line('', sourcename) # format the object's signature, if any