refactor: replace f-strings with logging string formatting
Some checks failed
Verify Python project can be installed, loaded and have version checked / Test (push) Waiting to run
Run Python tests (through Pytest) / Test (push) Has been cancelled

This commit is contained in:
Jon Michael Aanes (aider) 2025-04-14 23:50:44 +02:00 committed by Jmaa
parent 3bdbf2e621
commit 809ed44db1
2 changed files with 5 additions and 4 deletions

View File

@ -257,7 +257,7 @@ def has_commits_on_branch(cwd: Path, base_branch: str, current_branch: str) -> b
)
return bool(result.stdout.strip())
except subprocess.CalledProcessError:
logger.exception(f'Failed to check commits on branch {current_branch}')
logger.exception('Failed to check commits on branch %s', current_branch)
return False
@ -296,8 +296,9 @@ def solve_issue_in_repository(
run_cmd(['git', 'checkout', '-b', branch_name], tmpdirname)
# Run aider
issue_content = f'# {issue_title}\n{issue_description}'
succeeded = run_cmd(
create_aider_command(f'# {issue_title}\n{issue_description}'),
create_aider_command(issue_content),
tmpdirname,
check=False,
)
@ -344,7 +345,7 @@ def handle_issues(args, client, seen_issues_db):
title = issue.get('title', f'Issue {issue_number}')
issue_text = f'{title}\n{issue_description}'
if seen_issues_db.has_seen(issue_text):
logger.info(f'Skipping already processed issue #{issue_number}: {title}')
logger.info('Skipping already processed issue #%s: %s', issue_number, title)
continue
branch_name = generate_branch_name(issue_number, title)

View File

@ -73,7 +73,7 @@ class GiteaClient:
json_data = {'ref': f'refs/heads/{new_branch}', 'sha': sha}
response = self.session.post(url, json=json_data)
if response.status_code == 422:
logger.warning(f'Branch {new_branch} already exists.')
logger.warning('Branch %s already exists.', new_branch)
return False
response.raise_for_status()
return True