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

Function format_file

format_whitespace.py:42–52  ·  view source on GitHub ↗
(filename: str)

Source from the content-addressed store, hash-verified

40
41
42def format_file(filename: str) -> bool:
43 try:
44 with open(filename, 'r') as file:
45 data = file.read()
46 data = format_string(data)
47 with open(filename, 'w') as file:
48 file.write(data)
49 return True
50 except FileNotFoundError:
51 print(f'File not found, probably deleted: {filename}')
52 return False
53
54
55def main():

Callers 1

mainFunction · 0.85

Calls 3

format_stringFunction · 0.85
readMethod · 0.80
writeMethod · 0.80

Tested by

no test coverage detected