MCPcopy Create free account
hub / github.com/FastLED/FastLED / main

Function main

ci/tools/check_noexcept.py:320–385  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

318
319
320def main() -> int:
321 parser = argparse.ArgumentParser(
322 description=(
323 "Check for missing FL_NOEXCEPT in src/fl, src/platforms, and "
324 "src/third_party using clang-query AST analysis."
325 )
326 )
327 parser.add_argument(
328 "--scope",
329 choices=sorted(_SCOPES.keys()),
330 default="all",
331 help="Which owned src scope to check (default: all)",
332 )
333 parser.add_argument(
334 "--baseline",
335 type=Path,
336 default=DEFAULT_BASELINE,
337 help="Baseline file for existing missing annotations",
338 )
339 parser.add_argument(
340 "--no-baseline",
341 action="store_true",
342 help="Report every current finding instead of only new findings",
343 )
344 parser.add_argument(
345 "--update-baseline",
346 action="store_true",
347 help="Rewrite the baseline with the current findings",
348 )
349 args = parser.parse_args()
350
351 try:
352 hits = find_missing_noexcept(args.scope)
353 except NoexceptCheckError as exc:
354 print(f"ERROR: {exc}")
355 return 1
356
357 if args.update_baseline:
358 write_baseline(hits, args.baseline)
359 print(f"Wrote {len(hits)} FL_NOEXCEPT baseline entries to {args.baseline}")
360 return 0
361
362 if args.no_baseline:
363 report_hits = hits
364 stale: list[str] = []
365 else:
366 report_hits, stale = diff_against_baseline(hits, load_baseline(args.baseline))
367
368 if stale:
369 print(f"NOTE: {len(stale)} stale FL_NOEXCEPT baseline entrie(s) can be pruned.")
370 print(" Re-run with --update-baseline after intentional cleanup.")
371 print()
372
373 if not report_hits:
374 print("All non-baselined owned src functions have FL_NOEXCEPT.")
375 print(f"Known baseline entries: {len(hits) - len(report_hits)}")
376 return 0
377

Callers 1

check_noexcept.pyFile · 0.70

Calls 8

find_missing_noexceptFunction · 0.85
write_baselineFunction · 0.85
diff_against_baselineFunction · 0.85
load_baselineFunction · 0.85
_print_hitsFunction · 0.85
parse_argsMethod · 0.80
printFunction · 0.50
keysMethod · 0.45

Tested by

no test coverage detected