MCPcopy Index your code
hub / github.com/idank/explainshell / _fmt_value

Function _fmt_value

explainshell/diff.py:135–144  ·  view source on GitHub ↗
(val: object, indent: str, color: str)

Source from the content-addressed store, hash-verified

133
134
135def _fmt_value(val: object, indent: str, color: str) -> str:
136 s = str(val)
137 lines = s.split("\n")
138 if len(lines) == 1:
139 return f"{color}{indent}{s}{_RESET}"
140 out = [f"{color}{indent}{lines[0]}"]
141 for line in lines[1:]:
142 out.append(f"{indent} {line}")
143 out[-1] += _RESET
144 return "\n".join(out)
145
146
147def _fmt_text_diff(old_text: object, new_text: object, indent: str) -> str | None:

Callers 1

format_diffFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected