feat: add code quality pass to fix lint issues with aider before pushing
This commit is contained in:
parent
ce46cec191
commit
79b75dc165
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user