MCPcopy Create free account
hub / github.com/Frontrooms/3.0-GC / format_string

Function format_string

format_whitespace.py:32–39  ·  view source on GitHub ↗
(data: str)

Source from the content-addressed store, hash-verified

30
31
32def format_string(data: str):
33 data = re_leading_whitespace.sub(lambda m: m.group(0).replace('\t', ' '), data)
34 data = re_trailing_whitespace.sub('', data)
35 data = re_bracket_space.sub(') {', data)
36 data = re_keyword_space.sub(r'\1 ', data)
37 if not data.endswith('\n'): # Enforce trailing \n
38 data = data + '\n'
39 return data
40
41
42def format_file(filename: str) -> bool:

Callers 1

format_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected