mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 23:05:00 +00:00
cleanup
This commit is contained in:
parent
7fc02ccd66
commit
78af36ffda
4 changed files with 6 additions and 4 deletions
|
@ -156,18 +156,18 @@ class Commands:
|
||||||
def cmd_add(self, args):
|
def cmd_add(self, args):
|
||||||
"Add matching files to the chat session"
|
"Add matching files to the chat session"
|
||||||
|
|
||||||
from aider.dump import dump
|
|
||||||
|
|
||||||
added_fnames = []
|
added_fnames = []
|
||||||
files = self.coder.get_all_relative_files()
|
files = self.coder.get_all_relative_files()
|
||||||
for word in args.split():
|
for word in args.split():
|
||||||
matched_files = [file for file in files if word in file]
|
matched_files = [file for file in files if word in file]
|
||||||
|
|
||||||
dump(word, matched_files)
|
|
||||||
if not matched_files:
|
if not matched_files:
|
||||||
if self.coder.repo is not None:
|
if self.coder.repo is not None:
|
||||||
create_file = Confirm.ask(
|
create_file = Confirm.ask(
|
||||||
f"No files matched '{word}'. Do you want to create the file and add it to git?",
|
(
|
||||||
|
f"No files matched '{word}'. Do you want to create the file and add it"
|
||||||
|
" to git?"
|
||||||
|
),
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
create_file = Confirm.ask(
|
create_file = Confirm.ask(
|
||||||
|
|
0
bar.txt
0
bar.txt
0
foo.txt
0
foo.txt
|
@ -10,6 +10,8 @@ from aider.coder import Coder
|
||||||
class TestCommands(unittest.TestCase):
|
class TestCommands(unittest.TestCase):
|
||||||
def test_cmd_add(self):
|
def test_cmd_add(self):
|
||||||
with tempfile.TemporaryDirectory() as tmpdir:
|
with tempfile.TemporaryDirectory() as tmpdir:
|
||||||
|
os.chdir(tmpdir)
|
||||||
|
|
||||||
io = IO(pretty=False, yes=True)
|
io = IO(pretty=False, yes=True)
|
||||||
coder = Coder(
|
coder = Coder(
|
||||||
main_model="gpt-3.5-turbo",
|
main_model="gpt-3.5-turbo",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue