mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-07 10:29:52 +00:00
scripts/lib/kdoc/kdoc_files.py: allow filtering output per fname
For kerneldoc Sphinx extension, it is useful to display parsed results only from a single file. Change the logic at KernelFiles.msg() to allow such usage. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/9f5c0ff2568f34532ca99465fb378241d831d39f.1744106242.git.mchehab+huawei@kernel.org
This commit is contained in:
committed by
Jonathan Corbet
parent
fc862949a3
commit
a566ba5af5
@@ -95,7 +95,7 @@ class KernelFiles():
|
||||
doc = KernelDoc(self.config, fname)
|
||||
doc.run()
|
||||
|
||||
return doc
|
||||
return doc.entries
|
||||
|
||||
def process_export_file(self, fname):
|
||||
"""
|
||||
@@ -173,7 +173,7 @@ class KernelFiles():
|
||||
# Initialize internal variables
|
||||
|
||||
self.config.errors = 0
|
||||
self.results = []
|
||||
self.results = {}
|
||||
|
||||
self.files = set()
|
||||
self.export_files = set()
|
||||
@@ -189,13 +189,9 @@ class KernelFiles():
|
||||
# avoid reporting errors multiple times
|
||||
|
||||
for fname in glob.parse_files(file_list, self.file_not_found_cb):
|
||||
if fname in self.files:
|
||||
continue
|
||||
|
||||
res = self.parse_file(fname)
|
||||
|
||||
self.results.append((res.fname, res.entries))
|
||||
self.files.add(fname)
|
||||
if fname not in self.files:
|
||||
self.results[fname] = self.parse_file(fname)
|
||||
self.files.add(fname)
|
||||
|
||||
# If a list of export files was provided, parse EXPORT_SYMBOL*
|
||||
# from files that weren't fully parsed
|
||||
@@ -226,7 +222,8 @@ class KernelFiles():
|
||||
return self.out_style.msg(fname, name, arg)
|
||||
|
||||
def msg(self, enable_lineno=False, export=False, internal=False,
|
||||
symbol=None, nosymbol=None, no_doc_sections=False):
|
||||
symbol=None, nosymbol=None, no_doc_sections=False,
|
||||
filenames=None):
|
||||
"""
|
||||
Interacts over the kernel-doc results and output messages,
|
||||
returning kernel-doc markups on each interaction
|
||||
@@ -248,9 +245,12 @@ class KernelFiles():
|
||||
function_table, enable_lineno,
|
||||
no_doc_sections)
|
||||
|
||||
for fname, arg_tuple in self.results:
|
||||
if not filenames:
|
||||
filenames = sorted(self.results.keys())
|
||||
|
||||
for fname in filenames:
|
||||
msg = ""
|
||||
for name, arg in arg_tuple:
|
||||
for name, arg in self.results[fname]:
|
||||
msg += self.out_msg(fname, name, arg)
|
||||
|
||||
if msg is None:
|
||||
|
||||
Reference in New Issue
Block a user