MCPcopy Index your code
hub / github.com/python/cpython / add_checks_cli

Function add_checks_cli

Tools/c-analyzer/c_analyzer/__main__.py:128–145  ·  view source on GitHub ↗
(parser, checks=None, *, add_flags=None)

Source from the content-addressed store, hash-verified

126
127
128def add_checks_cli(parser, checks=None, *, add_flags=None):
129 default = False
130 if not checks:
131 checks = list(CHECKS)
132 default = True
133 elif isinstance(checks, str):
134 checks = [checks]
135 if (add_flags is None and len(checks) > 1) or default:
136 add_flags = True
137
138 process_checks = add_sepval_cli(parser, '--check', 'checks', checks)
139 if add_flags:
140 for check in checks:
141 parser.add_argument(f'--{check}', dest='checks',
142 action='append_const', const=check)
143 return [
144 process_checks,
145 ]
146
147
148def _get_check_handlers(fmt, printer, verbosity=VERBOSITY):

Callers 1

_cli_checkFunction · 0.85

Calls 3

add_sepval_cliFunction · 0.90
listClass · 0.85
add_argumentMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…