MCPcopy Create free account
hub / github.com/URLab-Sim/UnrealRoboticsLab / flush

Method flush

Scripts/codegen/_codegen_core.py:54–69  ·  view source on GitHub ↗

Print collected diagnostics to stderr, advance ``fired_count`` by the number flushed, and clear the pending list.

(self)

Source from the content-addressed store, hash-verified

52 self.pending.append(Diagnostic(message=message, source=source))
53
54 def flush(self) -> None:
55 """Print collected diagnostics to stderr, advance ``fired_count``
56 by the number flushed, and clear the pending list."""
57 if not self.pending:
58 return
59 print(f"\n--- codegen diagnostics ({len(self.pending)}) ---",
60 file=sys.stderr)
61 for d in self.pending:
62 print(d.message, file=sys.stderr)
63 print(
64 "(diagnostics are non-fatal; the codegen has emitted what it "
65 "can — fix the rules to silence them.)",
66 file=sys.stderr,
67 )
68 self.fired_count += len(self.pending)
69 self.pending.clear()
70
71 def reset(self) -> None:
72 self.pending.clear()

Callers 1

_diag_flushFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected