MCPcopy Create free account
hub / github.com/dagger/dagger / rewrite_notice

Function rewrite_notice

sdk/python/codegen/src/codegen/generator.py:458–469  ·  view source on GitHub ↗

Normalize deprecation/experimental messages and rewrite references.

(reason: str | None, prefix='"', suffix='"')

Source from the content-addressed store, hash-verified

456
457
458def rewrite_notice(reason: str | None, prefix='"', suffix='"') -> str | None:
459 """Normalize deprecation/experimental messages and rewrite references."""
460 if reason is None:
461 return None
462
463 reason = reason.strip()
464
465 def _format_name(match: re.Match[str]) -> str:
466 name = format_name(match.group(1))
467 return f"{prefix}{name}{suffix}"
468
469 return DEPRECATION_RE.sub(_format_name, reason)
470
471
472def format_name(s: str) -> str:

Callers 4

__init__Method · 0.85
deprecatedMethod · 0.85
experimentalMethod · 0.85
render_bodyMethod · 0.85

Calls 1

subMethod · 0.80

Tested by

no test coverage detected