MCPcopy Index your code
hub / github.com/bpython/bpython / leading_tabs_to_spaces

Function leading_tabs_to_spaces

bpython/curtsiesfrontend/preprocess.py:43–49  ·  view source on GitHub ↗
(s: str)

Source from the content-addressed store, hash-verified

41
42
43def leading_tabs_to_spaces(s: str) -> str:
44 def tab_to_space(m: Match[str]) -> str:
45 return len(m.group()) * 4 * " "
46
47 return "\n".join(
48 tabs_to_spaces_re.sub(tab_to_space, line) for line in s.split("\n")
49 )
50
51
52def preprocess(s: str, compiler: CommandCompiler) -> str:

Callers 1

preprocessFunction · 0.85

Calls 1

subMethod · 0.80

Tested by

no test coverage detected