mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 23:05:00 +00:00
fix linting errors
This commit is contained in:
parent
9776c5c615
commit
a793e9ac56
1 changed files with 5 additions and 6 deletions
|
@ -1,4 +1,5 @@
|
||||||
import os
|
import os
|
||||||
|
from rich.text import Text
|
||||||
|
|
||||||
|
|
||||||
class Commands:
|
class Commands:
|
||||||
|
@ -43,21 +44,19 @@ class Commands:
|
||||||
rest_inp = inp[len(words[0]) :]
|
rest_inp = inp[len(words[0]) :]
|
||||||
|
|
||||||
all_commands = self.get_commands()
|
all_commands = self.get_commands()
|
||||||
matching_commands = [
|
matching_commands = [cmd for cmd in all_commands if cmd.startswith(first_word)]
|
||||||
cmd for cmd in all_commands if cmd.startswith(first_word)
|
|
||||||
]
|
|
||||||
if len(matching_commands) == 1:
|
if len(matching_commands) == 1:
|
||||||
if matching_commands[0] == "/help":
|
if matching_commands[0] == "/help":
|
||||||
self.help()
|
self.help()
|
||||||
else:
|
else:
|
||||||
self.do_run(matching_commands[0][1:], rest_inp)
|
self.do_run(matching_commands[0][1:], rest_inp)
|
||||||
elif len(matching_commands) > 1:
|
elif len(matching_commands) > 1:
|
||||||
self.console.print(f"[red]Ambiguous command: {', '.join(matching_commands)}")
|
self.console.print("[red]Ambiguous command: ', '.join(matching_commands)}")
|
||||||
else:
|
else:
|
||||||
self.console.print(f"[red]Error: {first_word} is not a valid command.")
|
self.console.print(f"[red]Error: {first_word} is not a valid command.")
|
||||||
|
|
||||||
def cmd_commit(self, args):
|
def cmd_commit(self, args):
|
||||||
"Commit outstanding changes to the chat files. Aider will provide a commit message if yo u don't."
|
"Commit edits to chat files made outside the chat (commit message optional)"
|
||||||
|
|
||||||
if not self.coder.repo:
|
if not self.coder.repo:
|
||||||
self.console.print("[red]No git repository found.")
|
self.console.print("[red]No git repository found.")
|
||||||
|
@ -157,7 +156,7 @@ class Commands:
|
||||||
def cmd_ls(self, args):
|
def cmd_ls(self, args):
|
||||||
"List files and show their chat status"
|
"List files and show their chat status"
|
||||||
|
|
||||||
self.console.print(f"* denotes files included in the chat\n")
|
self.console.print("* denotes files included in the chat\n")
|
||||||
files = self.coder.get_active_files()
|
files = self.coder.get_active_files()
|
||||||
|
|
||||||
for file in files:
|
for file in files:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue