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: parse_features: make documentation more consistent

Do some changes to:
- add missing documentation strings to vars;
- add a missing docstring;
- ensure that phases will end with a period.

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

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
ef6aa110 cb472bb3

+20 -7
+20 -7
tools/lib/python/feat/parse_features.py
··· 21 21 from it. 22 22 """ 23 23 24 + #: feature header string. 24 25 h_name = "Feature" 26 + 27 + #: Kernel config header string. 25 28 h_kconfig = "Kconfig" 29 + 30 + #: description header string. 26 31 h_description = "Description" 32 + 33 + #: subsystem header string. 27 34 h_subsys = "Subsystem" 35 + 36 + #: status header string. 28 37 h_status = "Status" 38 + 39 + #: architecture header string. 29 40 h_arch = "Architecture" 30 41 31 - # Sort order for status. Others will be mapped at the end. 42 + #: Sort order for status. Others will be mapped at the end. 32 43 status_map = { 33 44 "ok": 0, 34 45 "TODO": 1, ··· 51 40 52 41 def __init__(self, prefix, debug=0, enable_fname=False): 53 42 """ 54 - Sets internal variables 43 + Sets internal variables. 55 44 """ 56 45 57 46 self.prefix = prefix ··· 74 63 self.msg = "" 75 64 76 65 def emit(self, msg="", end="\n"): 66 + """Helper function to append a new message for feature output.""" 67 + 77 68 self.msg += msg + end 78 69 79 70 def parse_error(self, fname, ln, msg, data=None): 80 71 """ 81 - Displays an error message, printing file name and line 72 + Displays an error message, printing file name and line. 82 73 """ 83 74 84 75 if ln: ··· 95 82 print("", file=sys.stderr) 96 83 97 84 def parse_feat_file(self, fname): 98 - """Parses a single arch-support.txt feature file""" 85 + """Parses a single arch-support.txt feature file.""" 99 86 100 87 if os.path.isdir(fname): 101 88 return ··· 217 204 self.max_size_arch_with_header = self.max_size_arch + len(self.h_arch) 218 205 219 206 def parse(self): 220 - """Parses all arch-support.txt feature files inside self.prefix""" 207 + """Parses all arch-support.txt feature files inside self.prefix.""" 221 208 222 209 path = os.path.expanduser(self.prefix) 223 210 ··· 294 281 295 282 def output_feature(self, feat): 296 283 """ 297 - Output a feature on all architectures 284 + Output a feature on all architectures. 298 285 """ 299 286 300 287 title = f"Feature {feat}" ··· 344 331 345 332 def matrix_lines(self, desc_size, max_size_status, header): 346 333 """ 347 - Helper function to split element tables at the output matrix 334 + Helper function to split element tables at the output matrix. 348 335 """ 349 336 350 337 if header: