From ffd5fbb6629eb20ba205830a816d847ca19aee18 Mon Sep 17 00:00:00 2001 From: Jon Michael Aanes Date: Sun, 13 Apr 2025 23:28:37 +0200 Subject: [PATCH] Ruff --- aider_gitea/__init__.py | 8 +++++--- aider_gitea/__main__.py | 1 + aider_gitea/gitea_client.py | 8 +++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/aider_gitea/__init__.py b/aider_gitea/__init__.py index 1ea4cd5..9d25f64 100644 --- a/aider_gitea/__init__.py +++ b/aider_gitea/__init__.py @@ -128,13 +128,15 @@ For code tasks: 3. Then, solve the issue by writing the required code. """ -#MODEL = 'ollama/gemma3:27b' +# MODEL = 'ollama/gemma3:27b' MODEL = 'ollama_chat/gemma3:27b' + def create_aider_command(issue: str) -> list[str]: return [ 'aider', - '--model', MODEL , + '--model', + MODEL, '--chat-language', 'english', '--test-cmd', @@ -144,7 +146,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', diff --git a/aider_gitea/__main__.py b/aider_gitea/__main__.py index f9daebc..9a1a1fc 100644 --- a/aider_gitea/__main__.py +++ b/aider_gitea/__main__.py @@ -74,5 +74,6 @@ def main(): logger.info('Sleeping for %d seconds...', args.interval) time.sleep(args.interval) + if __name__ == '__main__': main() diff --git a/aider_gitea/gitea_client.py b/aider_gitea/gitea_client.py index d04e78a..7c82627 100644 --- a/aider_gitea/gitea_client.py +++ b/aider_gitea/gitea_client.py @@ -1,6 +1,6 @@ import logging +from collections.abc import Iterator -from typing import Iterator import requests logger = logging.getLogger(__name__) @@ -82,7 +82,7 @@ class GiteaClient: response.raise_for_status() return True - def get_issues(self, owner: str, repo: str) -> list[dict[str,str]]: + def get_issues(self, owner: str, repo: str) -> list[dict[str, str]]: """ Download issues from the specified repository and filter those with the 'aider' label. @@ -108,7 +108,9 @@ class GiteaClient: ] return issues - def iter_user_repositories(self, owner: str, only_those_with_issues: bool = False) -> Iterator[str]: + def iter_user_repositories( + self, owner: str, only_those_with_issues: bool = False, + ) -> Iterator[str]: """ Get a list of repositories for a given user.