diff --git a/aider/coder.py b/aider/coder.py index 89845fe73..a1c2360fd 100755 --- a/aider/coder.py +++ b/aider/coder.py @@ -1,5 +1,6 @@ #!/usr/bin/env python + import os import sys import re @@ -51,9 +52,7 @@ class Coder: self.set_repo(fnames) if not self.repo: - self.console.print( - "[red]No suitable git repo, will not automatically commit edits." - ) + self.console.print("[red]No suitable git repo, will not automatically commit edits.") self.find_common_root() self.pretty = pretty @@ -112,18 +111,12 @@ class Coder: self.console.print(f"[bright_black]Files not tracked in {repo.git_dir}:") for fn in new_files: self.console.print(f"[bright_black] {fn}") - if Confirm.ask( - "[bright_black]Add them?", console=self.console, default="y" - ): + if Confirm.ask("[bright_black]Add them?", console=self.console, default="y"): for relative_fname in new_files: repo.git.add(relative_fname) - self.console.print( - f"[bright_black]Added {relative_fname} to the git repo" - ) + self.console.print(f"[bright_black]Added {relative_fname} to the git repo") show_files = ", ".join(new_files) - commit_message = ( - f"Initial commit: Added new files to the git repo: {show_files}" - ) + commit_message = f"Initial commit: Added new files to the git repo: {show_files}" repo.git.commit("-m", commit_message, "--no-verify") self.console.print( f"[bright_black]Committed new files with message: {commit_message}" @@ -361,7 +354,9 @@ class Coder: if not Path(full_path).exists(): question = f"[bright_black]Allow creation of new file {path}?" else: - question = f"[bright_black]Allow edits to {path} which was not previously provided?" + question = ( + f"[bright_black]Allow edits to {path} which was not previously provided?" + ) if not Confirm.ask(question, console=self.console, default="y"): self.console.print(f"[red]Skipping edit to {path}") continue @@ -454,9 +449,7 @@ class Coder: self.last_modified = self.get_last_modified() self.console.print("[bright_black]Files have uncommitted changes.\n") - self.console.print( - f"[bright_black]Suggested commit message:\n{commit_message}\n" - ) + self.console.print(f"[bright_black]Suggested commit message:\n{commit_message}\n") res = Prompt.ask( "[bright_black]Commit before the chat proceeds? \[y/n/commit message]", # noqa: W605 diff --git a/aider/commands.py b/aider/commands.py index 43aefd0ae..b2c31769b 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -151,10 +151,10 @@ 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?" - ) + 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?"