mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-06 04:35:00 +00:00
Add detailed error message when non-zero exit status occurs in Linter.
This commit is contained in:
parent
04084883e8
commit
2e6c7a13b2
1 changed files with 6 additions and 3 deletions
|
@ -42,11 +42,14 @@ class Linter:
|
||||||
cmd = cmd.split()
|
cmd = cmd.split()
|
||||||
try:
|
try:
|
||||||
subprocess.check_output(cmd, cwd=self.root).decode()
|
subprocess.check_output(cmd, cwd=self.root).decode()
|
||||||
print("zero")
|
|
||||||
return # zero exit status
|
return # zero exit status
|
||||||
except subprocess.CalledProcessError as err:
|
except subprocess.CalledProcessError as err:
|
||||||
print("non-zero")
|
errors = err.output.decode() # non-zero exit status
|
||||||
return err.output.decode() # non-zero exit status
|
|
||||||
|
res = "# Running: {cmd]\n"
|
||||||
|
res += "If the output below indicates errors or problems, fix them.\n"
|
||||||
|
res += "But if the command fixed all the issues itself, don't take further action.\n\n"
|
||||||
|
res += errors
|
||||||
|
|
||||||
def lint(self, fname):
|
def lint(self, fname):
|
||||||
lang = filename_to_lang(fname)
|
lang = filename_to_lang(fname)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue