MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / format_code_block

Function format_code_block

scripts/utils/ruffen-docs.py:110–122  ·  view source on GitHub ↗
(code: str)

Source from the content-addressed store, hash-verified

108
109
110def format_code_block(code: str) -> str:
111 return subprocess.check_output(
112 [
113 sys.executable,
114 "-m",
115 "ruff",
116 "format",
117 "--stdin-filename=script.py",
118 f"--line-length={DEFAULT_LINE_LENGTH}",
119 ],
120 encoding="utf-8",
121 input=code,
122 )
123
124
125def format_code_blocks(blocks: Sequence[str]) -> dict[str, str]:

Callers 3

_md_matchFunction · 0.85
finish_fragmentFunction · 0.85
format_collectedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected