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

Function format_rust_files_windows

run_format.py:359–381  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

357
358
359def format_rust_files_windows():
360 # PowerShell command to format all .rs files recursively in Windows
361 ps_command = (
362 "Get-ChildItem -Recurse -Filter *.rs | ForEach-Object { rustfmt $_.FullName }"
363 )
364
365 # Execute the PowerShell command
366 process = subprocess.Popen(
367 ["powershell", "-Command", ps_command],
368 stdout=subprocess.PIPE,
369 stderr=subprocess.PIPE,
370 text=True,
371 )
372
373 # Get the output and errors
374 stdout, stderr = process.communicate()
375
376 if process.returncode == 0:
377 print("Rust files formatted successfully on Windows!")
378 print(stdout)
379 else:
380 print("Error formatting Rust files on Windows:")
381 print(stderr)
382
383
384def run():

Callers 1

runFunction · 0.70

Calls 1

printFunction · 0.85

Tested by

no test coverage detected