MCPcopy
hub / github.com/doocs/leetcode / format_rust_files_linux

Function format_rust_files_linux

run_format.py:335–356  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

333
334
335def format_rust_files_linux():
336 # The find command to locate and format all .rs files in Linux
337 find_command = 'find . -name "*.rs" -exec rustfmt {} \\;'
338
339 # Execute the command
340 process = subprocess.Popen(
341 find_command,
342 shell=True,
343 stdout=subprocess.PIPE,
344 stderr=subprocess.PIPE,
345 text=True,
346 )
347
348 # Get the output and errors
349 stdout, stderr = process.communicate()
350
351 if process.returncode == 0:
352 print("Rust files formatted successfully on Linux!")
353 print(stdout)
354 else:
355 print("Error formatting Rust files on Linux:")
356 print(stderr)
357
358
359def format_rust_files_windows():

Callers 1

runFunction · 0.70

Calls 1

printFunction · 0.85

Tested by

no test coverage detected