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/kernel-doc.py: implement support for -no-doc-sections

The venerable kernel-doc Perl script has a number of options that
aren't properly documented. Among them, there is -no-doc-sections,
which is used by the Sphinx extension.

Implement support for it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/06b18a32142b44d5ba8b41ac64a76c02b03b4969.1744106242.git.mchehab+huawei@kernel.org

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
0873e554 799b0d2a

+15 -5
+6 -2
scripts/kernel-doc.py
··· 239 239 sel_mut.add_argument("-s", "-function", "--symbol", action='append', 240 240 help=FUNCTION_DESC) 241 241 242 - # This one is valid for all 3 types of filter 242 + # Those are valid for all 3 types of filter 243 243 parser.add_argument("-n", "-nosymbol", "--nosymbol", action='append', 244 244 help=NOSYMBOL_DESC) 245 + 246 + parser.add_argument("-D", "-no-doc-sections", "--no-doc-sections", 247 + action='store_true', help="Don't outputt DOC sections") 245 248 246 249 parser.add_argument("files", metavar="FILE", 247 250 nargs="+", help=FILES_DESC) ··· 287 284 288 285 for t in kfiles.msg(enable_lineno=args.enable_lineno, export=args.export, 289 286 internal=args.internal, symbol=args.symbol, 290 - nosymbol=args.nosymbol): 287 + nosymbol=args.nosymbol, 288 + no_doc_sections=args.no_doc_sections): 291 289 msg = t[1] 292 290 if msg: 293 291 print(msg)
+3 -2
scripts/lib/kdoc/kdoc_files.py
··· 238 238 return self.out_style.msg(fname, name, arg) 239 239 240 240 def msg(self, enable_lineno=False, export=False, internal=False, 241 - symbol=None, nosymbol=None): 241 + symbol=None, nosymbol=None, no_doc_sections=False): 242 242 """ 243 243 Interacts over the kernel-doc results and output messages, 244 244 returning kernel-doc markups on each interaction ··· 257 257 self.out_style.set_config(self.config) 258 258 259 259 self.out_style.set_filter(export, internal, symbol, nosymbol, 260 - function_table, enable_lineno) 260 + function_table, enable_lineno, 261 + no_doc_sections) 261 262 262 263 for fname, arg_tuple in self.results: 263 264 msg = ""
+6 -1
scripts/lib/kdoc/kdoc_output.py
··· 70 70 self.symbol = None 71 71 self.function_table = set() 72 72 self.config = None 73 + self.no_doc_sections = False 73 74 74 75 self.data = "" 75 76 ··· 78 77 self.config = config 79 78 80 79 def set_filter(self, export, internal, symbol, nosymbol, function_table, 81 - enable_lineno): 80 + enable_lineno, no_doc_sections): 82 81 """ 83 82 Initialize filter variables according with the requested mode. 84 83 ··· 88 87 """ 89 88 90 89 self.enable_lineno = enable_lineno 90 + self.no_doc_sections = no_doc_sections 91 91 92 92 if symbol: 93 93 self.out_mode = self.OUTPUT_INCLUDE ··· 118 116 119 117 def check_doc(self, name): 120 118 """Check if DOC should be output""" 119 + 120 + if self.no_doc_sections: 121 + return False 121 122 122 123 if self.out_mode == self.OUTPUT_ALL: 123 124 return True