diff --git a/aider/commands.py b/aider/commands.py index b2c31769b..b17b52478 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -102,9 +102,7 @@ class Commands: not last_commit.message.startswith("aider:") or last_commit.hexsha[:7] != self.coder.last_aider_commit_hash ): - self.console.print( - "[red]The last commit was not made by aider in this chat session." - ) + self.console.print("[red]The last commit was not made by aider in this chat session.") return self.coder.repo.git.reset("--hard", "HEAD~1") self.console.print( @@ -127,9 +125,7 @@ class Commands: commits = f"{self.coder.last_aider_commit_hash}~1" if self.coder.pretty: - diff = self.coder.repo.git.diff( - commits, "--color", self.coder.last_aider_commit_hash - ) + diff = self.coder.repo.git.diff(commits, "--color", self.coder.last_aider_commit_hash) else: diff = self.coder.repo.git.diff(commits, self.coder.last_aider_commit_hash) @@ -151,14 +147,14 @@ class Commands: matched_files = [file for file in files if word in file] if not matched_files: if self.coder.repo is not None: - create_file = Confirm.ask( - f"[bright_black]No files matched '{word}'. " - "Do you want to create the file and add it to git?" - ) - else: - create_file = Confirm.ask( - f"[bright_black]No files matched '{word}'. Do you want to create the file?" - ) + create_file = Confirm.ask( + f"[bright_black]No files matched '{word}'. " + "Do you want to create the file and add it to git?" + ) + else: + create_file = Confirm.ask( + f"[bright_black]No files matched '{word}'. Do you want to create the file?" + ) if create_file: with open(os.path.join(self.coder.root, word), "w"): @@ -171,14 +167,10 @@ class Commands: else: self.console.print(f"[red]No files matched '{word}'") for matched_file in matched_files: - abs_file_path = os.path.abspath( - os.path.join(self.coder.root, matched_file) - ) + abs_file_path = os.path.abspath(os.path.join(self.coder.root, matched_file)) if abs_file_path not in self.coder.abs_fnames: self.coder.abs_fnames.add(abs_file_path) - self.console.print( - f"[bright_black]Added {matched_file} to the chat" - ) + self.console.print(f"[bright_black]Added {matched_file} to the chat") added_fnames.append(matched_file) else: self.console.print(f"[red]{matched_file} is already in the chat") @@ -211,9 +203,7 @@ class Commands: for matched_file in matched_files: relative_fname = os.path.relpath(matched_file, self.coder.root) self.coder.abs_fnames.remove(matched_file) - self.console.print( - f"[bright_black]Removed {relative_fname} from the chat" - ) + self.console.print(f"[bright_black]Removed {relative_fname} from the chat") def cmd_ls(self, args): "List files and show their chat status"