Run ruff after aider
This commit is contained in:
parent
59e3efaf3c
commit
08b07b5dda
|
@ -34,6 +34,7 @@ logger = logging.getLogger(__name__)
|
|||
|
||||
|
||||
def bash_cmd(*commands: str) -> str:
|
||||
commands = ('set -e', *commands)
|
||||
return 'bash -c "' + ';'.join(commands) + '"'
|
||||
|
||||
|
||||
|
@ -44,10 +45,16 @@ AIDER_TEST = bash_cmd(
|
|||
'pytest test',
|
||||
)
|
||||
|
||||
AIDER_LINT = bash_cmd(
|
||||
RUFF_FORMAT_AND_AUTO_FIX = bash_cmd(
|
||||
'ruff format',
|
||||
'ruff check --fix --ignore RUF022 --ignore PGH004',
|
||||
'ruff format',
|
||||
'ruff check --fix --ignore RUF022 --ignore PGH004',
|
||||
)
|
||||
|
||||
AIDER_LINT = bash_cmd(
|
||||
RUFF_FORMAT_AND_AUTO_FIX,
|
||||
'ruff format',
|
||||
'ruff check --ignore RUF022 --ignore PGH004',
|
||||
)
|
||||
|
||||
|
@ -221,13 +228,22 @@ def solve_issue_in_repository(
|
|||
'https://',
|
||||
'git@',
|
||||
)
|
||||
|
||||
# Setup repository
|
||||
run_cmd(['git', 'clone', repo_url, tmpdirname])
|
||||
run_cmd(['bash', '-c', AIDER_TEST], tmpdirname)
|
||||
run_cmd(['git', 'checkout', args.base_branch], tmpdirname)
|
||||
run_cmd(['git', 'checkout', '-b', branch_name], tmpdirname)
|
||||
run_cmd(create_aider_command(f'# {issue_title}\n{issue_description}'), tmpdirname)
|
||||
run_cmd(['git', 'add', '.'], tmpdirname)
|
||||
|
||||
# Run aider
|
||||
run_cmd(create_aider_command(f'# {issue_title}\n{issue_description}'), tmpdirname)
|
||||
|
||||
# Auto-fix standard code quality stuff
|
||||
run_cmd(['bash', '-c', RUFF_FORMAT_AND_AUTO_FIX], tmpdirname)
|
||||
run_cmd(['git', 'add', '.'], tmpdirname)
|
||||
run_cmd(['git', 'commit', '-m', 'Ruff'], tmpdirname)
|
||||
|
||||
# Push changes
|
||||
return push_changes(
|
||||
tmpdirname,
|
||||
branch_name,
|
||||
|
|
Loading…
Reference in New Issue
Block a user