From 9fb74ee51b4a2671131e191ec8e9dc9565f5ee57 Mon Sep 17 00:00:00 2001 From: Jon Michael Aanes Date: Mon, 14 Apr 2025 23:43:53 +0200 Subject: [PATCH] Ruff --- aider_gitea/__init__.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/aider_gitea/__init__.py b/aider_gitea/__init__.py index 2510094..762817f 100644 --- a/aider_gitea/__init__.py +++ b/aider_gitea/__init__.py @@ -82,14 +82,14 @@ logger = logging.getLogger(__name__) def generate_branch_name(issue_number: str, issue_title: str) -> str: """Create a branch name by sanitizing the issue title. - + Non-alphanumeric characters (except spaces) are removed, the text is lowercased, and spaces are replaced with dashes. - + Args: issue_number: The issue number to include in the branch name. issue_title: The issue title to sanitize and include in the branch name. - + Returns: A sanitized branch name combining the issue number and title. """ @@ -137,7 +137,7 @@ For code tasks: """ # MODEL = 'ollama/gemma3:27b' -#MODEL = 'ollama_chat/gemma3:27b' +# MODEL = 'ollama_chat/gemma3:27b' def create_aider_command(issue: str) -> list[str]: @@ -148,7 +148,7 @@ def create_aider_command(issue: str) -> list[str]: '--cache-prompts', '--no-stream', #'--model', - #MODEL, + # MODEL, '--test-cmd', AIDER_TEST, '--lint-cmd', @@ -156,7 +156,7 @@ def create_aider_command(issue: str) -> list[str]: '--auto-test', '--no-auto-lint', '--api-key', - secrets.llm_api_key(), + secrets.llm_api_key(), '--read', 'CONVENTIONS.md', '--message', @@ -195,12 +195,12 @@ def push_changes( def has_commits_on_branch(cwd: Path, base_branch: str, current_branch: str) -> bool: """Check if there are any commits on the current branch that aren't in the base branch. - + Args: cwd: The current working directory (repository path). base_branch: The name of the base branch to compare against. current_branch: The name of the current branch to check for commits. - + Returns: True if there are commits on the current branch not in the base branch, False otherwise. """ @@ -220,12 +220,12 @@ def has_commits_on_branch(cwd: Path, base_branch: str, current_branch: str) -> b def run_cmd(cmd: list[str], cwd: Path | None = None, check=True) -> bool: """Run a shell command and return its success status. - + Args: cmd: The command to run as a list of strings. cwd: The directory to run the command in. check: Whether to raise an exception if the command fails. - + Returns: True if the command succeeded, False otherwise. """ @@ -279,7 +279,7 @@ def solve_issue_in_repository( def handle_issues(args, client, seen_issues_db): """Process all open issues with the 'aider' label. - + Args: args: Command line arguments. client: The Gitea client instance.