refactor: replace f-strings with logging string formatting
This commit is contained in:
parent
3bdbf2e621
commit
809ed44db1
|
@ -257,7 +257,7 @@ def has_commits_on_branch(cwd: Path, base_branch: str, current_branch: str) -> b
|
||||||
)
|
)
|
||||||
return bool(result.stdout.strip())
|
return bool(result.stdout.strip())
|
||||||
except subprocess.CalledProcessError:
|
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
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
@ -296,8 +296,9 @@ def solve_issue_in_repository(
|
||||||
run_cmd(['git', 'checkout', '-b', branch_name], tmpdirname)
|
run_cmd(['git', 'checkout', '-b', branch_name], tmpdirname)
|
||||||
|
|
||||||
# Run aider
|
# Run aider
|
||||||
|
issue_content = f'# {issue_title}\n{issue_description}'
|
||||||
succeeded = run_cmd(
|
succeeded = run_cmd(
|
||||||
create_aider_command(f'# {issue_title}\n{issue_description}'),
|
create_aider_command(issue_content),
|
||||||
tmpdirname,
|
tmpdirname,
|
||||||
check=False,
|
check=False,
|
||||||
)
|
)
|
||||||
|
@ -344,7 +345,7 @@ def handle_issues(args, client, seen_issues_db):
|
||||||
title = issue.get('title', f'Issue {issue_number}')
|
title = issue.get('title', f'Issue {issue_number}')
|
||||||
issue_text = f'{title}\n{issue_description}'
|
issue_text = f'{title}\n{issue_description}'
|
||||||
if seen_issues_db.has_seen(issue_text):
|
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
|
continue
|
||||||
|
|
||||||
branch_name = generate_branch_name(issue_number, title)
|
branch_name = generate_branch_name(issue_number, title)
|
||||||
|
|
|
@ -73,7 +73,7 @@ class GiteaClient:
|
||||||
json_data = {'ref': f'refs/heads/{new_branch}', 'sha': sha}
|
json_data = {'ref': f'refs/heads/{new_branch}', 'sha': sha}
|
||||||
response = self.session.post(url, json=json_data)
|
response = self.session.post(url, json=json_data)
|
||||||
if response.status_code == 422:
|
if response.status_code == 422:
|
||||||
logger.warning(f'Branch {new_branch} already exists.')
|
logger.warning('Branch %s already exists.', new_branch)
|
||||||
return False
|
return False
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in New Issue
Block a user