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.

docs: kdoc: ensure that comments are using our coding style

Along kernel-doc libs, we opted to have all comments starting/ending
with a blank comment line. Use the same style here.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <50e430acd333a500719205e80ab3b2d297edcd7d.1768823489.git.mchehab+huawei@kernel.org>

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
bd28e997 802774d8

+18 -6
+18 -6
scripts/kernel-doc.py
··· 3 3 # Copyright(c) 2025: Mauro Carvalho Chehab <mchehab@kernel.org>. 4 4 # 5 5 # pylint: disable=C0103,R0912,R0914,R0915 6 - 6 + # 7 7 # NOTE: While kernel-doc requires at least version 3.6 to run, the 8 8 # command line should work with Python 3.2+ (tested with 3.4). 9 9 # The rationale is that it shall fail gracefully during Kernel ··· 12 12 # - no f-strings can be used on this file. 13 13 # - the libraries that require newer versions can only be included 14 14 # after Python version is checked. 15 - 15 + # 16 16 # Converted from the kernel-doc script originally written in Perl 17 17 # under GPLv2, copyrighted since 1998 by the following authors: 18 18 # ··· 197 197 parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter, 198 198 description=DESC) 199 199 200 + # 200 201 # Normal arguments 201 - 202 + # 202 203 parser.add_argument("-v", "-verbose", "--verbose", action="store_true", 203 204 help="Verbose output, more warnings and other information.") 204 205 ··· 214 213 action="store_true", 215 214 help="Enable line number output (only in ReST mode)") 216 215 216 + # 217 217 # Arguments to control the warning behavior 218 - 218 + # 219 219 parser.add_argument("-Wreturn", "--wreturn", action="store_true", 220 220 help="Warns about the lack of a return markup on functions.") 221 221 ··· 237 235 parser.add_argument("-export-file", "--export-file", action='append', 238 236 help=EXPORT_FILE_DESC) 239 237 238 + # 240 239 # Output format mutually-exclusive group 241 - 240 + # 242 241 out_group = parser.add_argument_group("Output format selection (mutually exclusive)") 243 242 244 243 out_fmt = out_group.add_mutually_exclusive_group() ··· 251 248 out_fmt.add_argument("-N", "-none", "--none", action="store_true", 252 249 help="Do not output documentation, only warnings.") 253 250 251 + # 254 252 # Output selection mutually-exclusive group 255 - 253 + # 256 254 sel_group = parser.add_argument_group("Output selection (mutually exclusive)") 257 255 sel_mut = sel_group.add_mutually_exclusive_group() 258 256 ··· 266 262 sel_mut.add_argument("-s", "-function", "--symbol", action='append', 267 263 help=FUNCTION_DESC) 268 264 265 + # 269 266 # Those are valid for all 3 types of filter 267 + # 270 268 parser.add_argument("-n", "-nosymbol", "--nosymbol", action='append', 271 269 help=NOSYMBOL_DESC) 272 270 ··· 301 295 302 296 python_ver = sys.version_info[:2] 303 297 if python_ver < (3,6): 298 + # 304 299 # Depending on Kernel configuration, kernel-doc --none is called at 305 300 # build time. As we don't want to break compilation due to the 306 301 # usage of an old Python version, return 0 here. 302 + # 307 303 if args.none: 308 304 logger.error("Python 3.6 or later is required by kernel-doc. skipping checks") 309 305 sys.exit(0) ··· 315 307 if python_ver < (3,7): 316 308 logger.warning("Python 3.7 or later is required for correct results") 317 309 310 + # 318 311 # Import kernel-doc libraries only after checking Python version 312 + # 319 313 from kdoc.kdoc_files import KernelFiles # pylint: disable=C0415 320 314 from kdoc.kdoc_output import RestFormat, ManFormat # pylint: disable=C0415 321 315 ··· 356 346 357 347 sys.exit(0) 358 348 349 + # 359 350 # Call main method 351 + # 360 352 if __name__ == "__main__": 361 353 main()