style: format code with linter

This commit is contained in:
Paul Gauthier (aider) 2024-08-20 17:28:08 -07:00
parent 6f0d9a09df
commit 7bcd6d4ebb

View file

@ -1,8 +1,8 @@
import difflib import difflib
import math import math
import re import re
import sys
import subprocess import subprocess
import sys
from difflib import SequenceMatcher from difflib import SequenceMatcher
from pathlib import Path from pathlib import Path
@ -42,8 +42,12 @@ class EditBlockCoder(Coder):
self.io.tool_output(f"Shell command: {edit}") self.io.tool_output(f"Shell command: {edit}")
if self.io.confirm_ask("Do you want to run this command?"): if self.io.confirm_ask("Do you want to run this command?"):
try: try:
result = subprocess.run(edit, shell=True, check=True, text=True, capture_output=True) result = subprocess.run(
self.io.tool_output(f"Command executed successfully. Output:\n{result.stdout}") edit, shell=True, check=True, text=True, capture_output=True
)
self.io.tool_output(
f"Command executed successfully. Output:\n{result.stdout}"
)
if result.stderr: if result.stderr:
self.io.tool_output(f"Errors:\n{result.stderr}") self.io.tool_output(f"Errors:\n{result.stderr}")
passed.append(edit) passed.append(edit)