mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 06:15:00 +00:00
lint
This commit is contained in:
parent
14f863e732
commit
d279f9751f
1 changed files with 13 additions and 9 deletions
14
coder.py
14
coder.py
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
|
||||
import sys
|
||||
import re
|
||||
import readline
|
||||
|
@ -34,6 +35,7 @@ except FileNotFoundError:
|
|||
|
||||
openai.api_key = os.getenv("OPENAI_API_KEY")
|
||||
|
||||
|
||||
def find_index(list1, list2):
|
||||
for i in range(len(list1)):
|
||||
if list1[i : i + len(list2)] == list2:
|
||||
|
@ -212,7 +214,7 @@ class Coder:
|
|||
message=commit_message,
|
||||
)
|
||||
else:
|
||||
self.console.print('[red bold]Edits failed to change the files?')
|
||||
self.console.print("[red bold]Edits failed to change the files?")
|
||||
saved_message = prompts.files_content_gpt_no_edits
|
||||
|
||||
self.check_for_local_edits(True)
|
||||
|
@ -444,7 +446,7 @@ class Coder:
|
|||
if not repo.is_dirty():
|
||||
return
|
||||
|
||||
diffs = ''
|
||||
diffs = ""
|
||||
dirty_fnames = []
|
||||
relative_dirty_fnames = []
|
||||
for fname in self.fnames:
|
||||
|
@ -497,12 +499,14 @@ class Coder:
|
|||
self.console.print(f"[red]Suggested commit message:\n{commit_message}\n")
|
||||
|
||||
if ask:
|
||||
res = Prompt.ask("[red]Commit before the chat proceeds? \[y/n/commit message]").strip()
|
||||
res = Prompt.ask(
|
||||
"[red]Commit before the chat proceeds? \[y/n/commit message]"
|
||||
).strip()
|
||||
|
||||
if res.lower() in ['n', 'no']:
|
||||
if res.lower() in ["n", "no"]:
|
||||
self.console.print("[red]Skipped commmit.")
|
||||
return
|
||||
if res.lower() not in ['y', 'yes']:
|
||||
if res.lower() not in ["y", "yes"]:
|
||||
commit_message = res
|
||||
|
||||
repo.git.add(*relative_dirty_fnames)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue