Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
a566ba5a fc862949

+12 -12
+12 -12
scripts/lib/kdoc/kdoc_files.py
··· 95 95 doc = KernelDoc(self.config, fname) 96 96 doc.run() 97 97 98 - return doc 98 + return doc.entries 99 99 100 100 def process_export_file(self, fname): 101 101 """ ··· 173 173 # Initialize internal variables 174 174 175 175 self.config.errors = 0 176 - self.results = [] 176 + self.results = {} 177 177 178 178 self.files = set() 179 179 self.export_files = set() ··· 189 189 # avoid reporting errors multiple times 190 190 191 191 for fname in glob.parse_files(file_list, self.file_not_found_cb): 192 - if fname in self.files: 193 - continue 194 - 195 - res = self.parse_file(fname) 196 - 197 - self.results.append((res.fname, res.entries)) 198 - self.files.add(fname) 192 + if fname not in self.files: 193 + self.results[fname] = self.parse_file(fname) 194 + self.files.add(fname) 199 195 200 196 # If a list of export files was provided, parse EXPORT_SYMBOL* 201 197 # from files that weren't fully parsed ··· 222 226 return self.out_style.msg(fname, name, arg) 223 227 224 228 def msg(self, enable_lineno=False, export=False, internal=False, 225 - symbol=None, nosymbol=None, no_doc_sections=False): 229 + symbol=None, nosymbol=None, no_doc_sections=False, 230 + filenames=None): 226 231 """ 227 232 Interacts over the kernel-doc results and output messages, 228 233 returning kernel-doc markups on each interaction ··· 245 248 function_table, enable_lineno, 246 249 no_doc_sections) 247 250 248 - for fname, arg_tuple in self.results: 251 + if not filenames: 252 + filenames = sorted(self.results.keys()) 253 + 254 + for fname in filenames: 249 255 msg = "" 250 - for name, arg in arg_tuple: 256 + for name, arg in self.results[fname]: 251 257 msg += self.out_msg(fname, name, arg) 252 258 253 259 if msg is None: