Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Justintime50 committed Nov 13, 2023
1 parent 9913b38 commit 06e6335
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
6 changes: 3 additions & 3 deletions harvey/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def clone_repo(project_path: str, webhook: Dict[str, Any]) -> str:
command_output = ''

try:
command_output = run_subprocess_command(
['git', 'clone', '--depth=1', Webhook.repo_url(webhook), project_path]
)
command_output = run_subprocess_command([
'git', 'clone', '--depth=1', Webhook.repo_url(webhook), project_path
])
logger.debug(command_output)
except subprocess.TimeoutExpired:
kill_deployment(
Expand Down
6 changes: 3 additions & 3 deletions harvey/repos/deployments.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ def retrieve_deployments(request: flask.Request) -> Dict[str, List[Any]]:
pass

sorted_deployments = sorted(deployments['deployments'], key=lambda i: i['timestamp'], reverse=True)[:page_size]
deployments['total_count'] = len(
[attempt for deployment in deployments['deployments'] for attempt in deployment.get('attempts', [])]
)
deployments['total_count'] = len([
attempt for deployment in deployments['deployments'] for attempt in deployment.get('attempts', [])
])
deployments['deployments'] = sorted_deployments

return deployments
10 changes: 4 additions & 6 deletions harvey/repos/locks.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,10 @@ def retrieve_locks(request: flask.Request) -> Dict[str, List[Any]]:

with SqliteDict(filename=Config.database_file, tablename=DATABASE_TABLE_NAME) as database_table:
for key, values in database_table.items():
locks['locks'].append(
{
'project': key,
'locked': values['locked'],
}
)
locks['locks'].append({
'project': key,
'locked': values['locked'],
})

sorted_locks = sorted(locks['locks'], key=lambda x: x['project'])[:page_size]
locks['total_count'] = len(locks['locks'])
Expand Down

0 comments on commit 06e6335

Please sign in to comment.