MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / main

Function main

tools/release/run-clang-format.py:258–422  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

256
257
258def main():
259 parser = argparse.ArgumentParser(description=__doc__)
260 parser.add_argument(
261 "--clang-format-executable",
262 metavar="EXECUTABLE",
263 help="path to the clang-format executable",
264 default="clang-format",
265 )
266 parser.add_argument(
267 "--extensions",
268 help="comma separated list of file extensions (default: {})".format(
269 DEFAULT_EXTENSIONS
270 ),
271 default=DEFAULT_EXTENSIONS,
272 )
273 parser.add_argument(
274 "-r",
275 "--recursive",
276 action="store_true",
277 help="run recursively over directories",
278 )
279 parser.add_argument(
280 "-d", "--dry-run", action="store_true", help="just print the list of files"
281 )
282 parser.add_argument(
283 "-i",
284 "--in-place",
285 action="store_true",
286 help="format file instead of printing differences",
287 )
288 parser.add_argument("files", metavar="file", nargs="+")
289 parser.add_argument(
290 "-q",
291 "--quiet",
292 action="store_true",
293 help="disable output, useful for the exit code",
294 )
295 parser.add_argument(
296 "-j",
297 metavar="N",
298 type=int,
299 default=0,
300 help="run N clang-format jobs in parallel" " (default number of cpus + 1)",
301 )
302 parser.add_argument(
303 "--color",
304 default="auto",
305 choices=["auto", "always", "never"],
306 help="show colored diff (default: auto)",
307 )
308 parser.add_argument(
309 "-e",
310 "--exclude",
311 metavar="PATTERN",
312 action="append",
313 default=[],
314 help="exclude paths matching the given glob-like pattern(s)"
315 " from recursive search",

Callers 1

Calls 8

print_troubleFunction · 0.85
excludes_from_fileFunction · 0.85
list_filesFunction · 0.85
print_diffFunction · 0.85
signalMethod · 0.80
writeMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected