MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / _brace_delta

Function _brace_delta

scripts/code-verify.py:449–461  ·  view source on GitHub ↗

Net change in brace depth this logical line contributes.

(line: LogicalLine)

Source from the content-addressed store, hash-verified

447
448
449def _brace_delta(line: LogicalLine) -> int:
450 """Net change in brace depth this logical line contributes."""
451 if line.kind in ("comment", "blank"):
452 return 0
453 opens = 0
454 closes = 0
455 for raw in line.raws:
456 # Fast-and-loose — string literals inside prop values could fool us,
457 # but property values ending in `{` are already classified as "open"
458 # which is fine for our needs.
459 opens += raw.count("{")
460 closes += raw.count("}")
461 return opens - closes
462
463
464# ---------------------------------------------------------------------------

Callers 2

check_id_placementFunction · 0.85
_check_shallow_idFunction · 0.85

Calls 1

countMethod · 0.45

Tested by

no test coverage detected