Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Justintime50 committed Dec 21, 2023
1 parent 43fca62 commit 7f488d2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 23 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
16 changes: 7 additions & 9 deletions test/unit/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,13 @@ def mock_webhook(branch='main'):
"name": "TEST_owner",
},
},
"commits": [
{
"id": 123456,
"author": {
"name": "test_user",
},
"message": "Mock message",
}
],
"commits": [{
"id": 123456,
"author": {
"name": "test_user",
},
"message": "Mock message",
}],
}

return mock_webhook
Expand Down
14 changes: 6 additions & 8 deletions test/unit/test_deployments.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,12 @@ def test_open_project_config(mock_json, mock_isfile):
"repository": {
"full_name": "TEST_user/TEST-repo-name",
},
"commits": [
{
"id": 123456,
"author": {
"name": "test_user",
},
}
],
"commits": [{
"id": 123456,
"author": {
"name": "test_user",
},
}],
}
with patch('builtins.open', mock_open()):
config = Deployment.open_project_config(mock_webhook)
Expand Down

0 comments on commit 7f488d2

Please sign in to comment.