mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 09:14:59 +00:00
style: format code with linter
This commit is contained in:
parent
afa7d02906
commit
e1c8a25e2e
1 changed files with 9 additions and 4 deletions
|
@ -10,7 +10,12 @@ import pexpect
|
||||||
def run_cmd(command):
|
def run_cmd(command):
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
if False and sys.stdin.isatty() and hasattr(pexpect, "spawn") and platform.system() != "Windows":
|
if (
|
||||||
|
False
|
||||||
|
and sys.stdin.isatty()
|
||||||
|
and hasattr(pexpect, "spawn")
|
||||||
|
and platform.system() != "Windows"
|
||||||
|
):
|
||||||
return run_cmd_pexpect(command)
|
return run_cmd_pexpect(command)
|
||||||
|
|
||||||
return run_cmd_subprocess(command)
|
return run_cmd_subprocess(command)
|
||||||
|
@ -27,16 +32,16 @@ def run_cmd_subprocess(command):
|
||||||
encoding=sys.stdout.encoding,
|
encoding=sys.stdout.encoding,
|
||||||
errors="replace",
|
errors="replace",
|
||||||
bufsize=1,
|
bufsize=1,
|
||||||
universal_newlines=True
|
universal_newlines=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
output = []
|
output = []
|
||||||
for line in process.stdout:
|
for line in process.stdout:
|
||||||
print(line, end='') # Print the line in real-time
|
print(line, end="") # Print the line in real-time
|
||||||
output.append(line) # Store the line for later use
|
output.append(line) # Store the line for later use
|
||||||
|
|
||||||
process.wait()
|
process.wait()
|
||||||
return process.returncode, ''.join(output)
|
return process.returncode, "".join(output)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return 1, str(e)
|
return 1, str(e)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue