MCPcopy
hub / github.com/Aider-AI/aider / run_cmd

Method run_cmd

aider/linter.py:47–68  ·  view source on GitHub ↗
(self, cmd, rel_fname, code)

Source from the content-addressed store, hash-verified

45 return fname
46
47 def run_cmd(self, cmd, rel_fname, code):
48 cmd += " " + oslex.quote(rel_fname)
49
50 returncode = 0
51 stdout = ""
52 try:
53 returncode, stdout = run_cmd_subprocess(
54 cmd,
55 cwd=self.root,
56 encoding=self.encoding,
57 )
58 except OSError as err:
59 print(f"Unable to execute lint command: {err}")
60 return
61 errors = stdout
62 if returncode == 0:
63 return # zero exit status
64
65 res = f"## Running: {cmd}\n\n"
66 res += errors
67
68 return self.errors_to_lint_result(rel_fname, res)
69
70 def errors_to_lint_result(self, rel_fname, errors):
71 if not errors:

Callers 5

lintMethod · 0.95
test_run_cmd_winMethod · 0.95
test_run_cmdMethod · 0.80

Calls 2

errors_to_lint_resultMethod · 0.95
run_cmd_subprocessFunction · 0.90

Tested by 4

test_run_cmd_winMethod · 0.76
test_run_cmdMethod · 0.64