mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 22:34:59 +00:00
Added lint/test_outcome
This commit is contained in:
parent
41c678da09
commit
cb6e7cabb6
2 changed files with 12 additions and 2 deletions
|
@ -62,6 +62,8 @@ class Coder:
|
||||||
auto_lint = True
|
auto_lint = True
|
||||||
auto_test = False
|
auto_test = False
|
||||||
test_cmd = None
|
test_cmd = None
|
||||||
|
lint_outcome = None
|
||||||
|
test_outcome = None
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create(
|
def create(
|
||||||
|
@ -506,13 +508,18 @@ class Coder:
|
||||||
|
|
||||||
def run_stream(self, user_message):
|
def run_stream(self, user_message):
|
||||||
self.io.user_input(user_message)
|
self.io.user_input(user_message)
|
||||||
|
self.init_before_message()
|
||||||
|
yield from self.send_new_user_message(user_message)
|
||||||
|
|
||||||
|
def init_before_message(self):
|
||||||
self.reflected_message = None
|
self.reflected_message = None
|
||||||
self.num_reflections = 0
|
self.num_reflections = 0
|
||||||
yield from self.send_new_user_message(user_message)
|
self.lint_outcome = None
|
||||||
|
self.test_outcome = None
|
||||||
|
|
||||||
def run(self, with_message=None):
|
def run(self, with_message=None):
|
||||||
while True:
|
while True:
|
||||||
self.num_reflections = 0
|
self.init_before_message()
|
||||||
try:
|
try:
|
||||||
if with_message:
|
if with_message:
|
||||||
new_user_message = with_message
|
new_user_message = with_message
|
||||||
|
@ -758,6 +765,7 @@ class Coder:
|
||||||
|
|
||||||
if edited and self.auto_lint:
|
if edited and self.auto_lint:
|
||||||
lint_errors = self.lint_edited(edited)
|
lint_errors = self.lint_edited(edited)
|
||||||
|
self.lint_outcome = not lint_errors
|
||||||
if lint_errors:
|
if lint_errors:
|
||||||
self.reflected_message = lint_errors
|
self.reflected_message = lint_errors
|
||||||
self.update_cur_messages(set())
|
self.update_cur_messages(set())
|
||||||
|
@ -765,6 +773,7 @@ class Coder:
|
||||||
|
|
||||||
if edited and self.auto_test:
|
if edited and self.auto_test:
|
||||||
test_errors = self.commands.cmd_test(self.test_cmd)
|
test_errors = self.commands.cmd_test(self.test_cmd)
|
||||||
|
self.test_outcome = not test_errors
|
||||||
if test_errors:
|
if test_errors:
|
||||||
self.reflected_message = test_errors
|
self.reflected_message = test_errors
|
||||||
self.update_cur_messages(set())
|
self.update_cur_messages(set())
|
||||||
|
|
|
@ -26,6 +26,7 @@ pypandoc
|
||||||
litellm
|
litellm
|
||||||
google-generativeai
|
google-generativeai
|
||||||
streamlit
|
streamlit
|
||||||
|
flake8
|
||||||
|
|
||||||
# v3.3 no longer works on python 3.9
|
# v3.3 no longer works on python 3.9
|
||||||
networkx<3.3
|
networkx<3.3
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue