MCPcopy
hub / github.com/openai/openai-python / format_code_block

Function format_code_block

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

Source from the content-addressed store, hash-verified

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

Callers 2

_md_matchFunction · 0.85
finish_fragmentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected