mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] docs: Better handle kernel-doc class
@ 2025-05-20  8:55 Mauro Carvalho Chehab
  2025-05-20  8:55 ` [PATCH 1/2] scripts: kernel-doc: prevent a KeyError when checking output Mauro Carvalho Chehab
  2025-05-20  8:55 ` [PATCH 2/2] docs: kerneldoc.py: add try/except blocks for kernel-doc class errors Mauro Carvalho Chehab
  0 siblings, 2 replies; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2025-05-20  8:55 UTC (permalink / raw)
  To: Jonathan Corbet; +Cc: Mauro Carvalho Chehab, linux-doc, linux-kernel

Currently, there is an issue with kernel-doc KernelFiles class:
if one tries to add a kernel-doc tag to a non-existing file, it
will produce a KeyError, as KernelFiles.msg() will try to pick a
key from a non-existing file. Add a check to prevent such error.

With that, building docs with broken files will work as before(*):

	$ make htmldocs
	...
	Cannot find file ./drivers/gpio/gpiolib-acpi.c
	Cannot find file ./drivers/gpio/gpiolib-acpi.c
	No kernel-doc for file ./drivers/gpio/gpiolib-acpi.c
	...
	Documentation/arch/powerpc/htm.rst: WARNING: document isn't included in any toctree

While here, also better handle errors at the kernel-doc classes.

(*) IMO, this is the wrong behavior, but let's discuss it in separate.

Mauro Carvalho Chehab (2):
  scripts: kernel-doc: prevent a KeyError when checking output
  docs: kerneldoc.py: add try/except blocks for kernel-doc class errors

 Documentation/sphinx/kerneldoc.py | 21 +++++++++++++++++----
 scripts/lib/kdoc/kdoc_files.py    |  4 ++++
 2 files changed, 21 insertions(+), 4 deletions(-)

-- 
2.49.0



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-05-20  8:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-20  8:55 [PATCH 0/2] docs: Better handle kernel-doc class Mauro Carvalho Chehab
2025-05-20  8:55 ` [PATCH 1/2] scripts: kernel-doc: prevent a KeyError when checking output Mauro Carvalho Chehab
2025-05-20  8:55 ` [PATCH 2/2] docs: kerneldoc.py: add try/except blocks for kernel-doc class errors Mauro Carvalho Chehab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®