feat: add code quality pass to fix lint issues with aider before pushing

This commit is contained in:
Jon Michael Aanes (aider) 2025-04-20 01:14:52 +02:00
parent ce46cec191
commit 79b75dc165

View File

@ -380,6 +380,21 @@ def solve_issue_in_repository(
) )
return IssueResolution(False) return IssueResolution(False)
# Code quality pass: ensure ruff passes
result = subprocess.run(
['bash', '-c', 'ruff check .'],
check=False,
cwd=tmpdirname,
capture_output=True,
text=True,
)
if result.returncode != 0:
logger.info('Code quality issues detected, invoking aider to fix lint...')
run_cmd(create_aider_command(issue_content), tmpdirname, check=False)
run_cmd(['bash', '-c', RUFF_FORMAT_AND_AUTO_FIX], tmpdirname, check=False)
run_cmd(['git', 'add', '.'], tmpdirname)
run_cmd(['git', 'commit', '-m', 'Aider lint fixes'], tmpdirname, check=False)
# Push changes # Push changes
return push_changes( return push_changes(
repository_config, repository_config,