Skip to content

Commit

Permalink
Adjust coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
henryruhs committed May 10, 2024
1 parent 12c3d5e commit ae701d8
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
MIT license

Copyright (c) 2023 Henry Ruhs
Copyright (c) 2024 Henry Ruhs
4 changes: 2 additions & 2 deletions chroma_feedback/producer/appveyor/appveyor/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ def normalize_data(slug : str, status : str) -> Producer:
def normalize_status(status : str) -> Status:
status = helper.to_lower_case(status)

if status in ['queued', 'running', 'starting']:
if status in [ 'queued', 'running', 'starting' ]:
return 'started'
if status in ['canceled', 'cancelling']:
if status in [ 'canceled', 'cancelling' ]:
return 'errored'
if status == 'failed':
return 'failed'
Expand Down
2 changes: 1 addition & 1 deletion chroma_feedback/producer/atlassian/bitbucket/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def normalize_status(status : str, result : str) -> Status:
status = helper.to_lower_case(status)
result = helper.to_lower_case(result)

if status in ['in_progress', 'pending']:
if status in [ 'in_progress', 'pending' ]:
return 'started'
if result == 'stopped':
return 'errored'
Expand Down
2 changes: 1 addition & 1 deletion chroma_feedback/producer/circle/circle/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def fetch_pipeline_ids(host : str, organization : str, slug : str, token : str)


def create_headers(token : str) -> Headers:
return \
return\
{
'Accept': 'application/json',
'Circle-Token': token
Expand Down
4 changes: 2 additions & 2 deletions chroma_feedback/producer/circle/circle/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ def normalize_status(status : str) -> Status:

if status == 'no_tests':
return 'skipped'
if status in ['queued', 'retried', 'running', 'scheduled']:
if status in [ 'queued', 'retried', 'running', 'scheduled' ]:
return 'started'
if status == 'canceled':
return 'errored'
if status == 'timedout':
return 'warned'
if status in ['failed', 'infrastructure_fail']:
if status in [ 'failed', 'infrastructure_fail' ]:
return 'failed'
return 'passed'

6 changes: 3 additions & 3 deletions chroma_feedback/producer/cloudbees/codeship/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ def normalize_status(status : str) -> Status:

if status == 'ignored':
return 'skipped'
if status in ['initiated', 'testing', 'waiting']:
if status in [ 'initiated', 'testing', 'waiting' ]:
return 'started'
if status in ['error', 'blocked']:
if status in [ 'error', 'blocked' ]:
return 'errored'
if status in ['failed', 'infrastructure_failure']:
if status in [ 'failed', 'infrastructure_failure' ]:
return 'failed'
return 'passed'
2 changes: 1 addition & 1 deletion chroma_feedback/producer/datadog/datadog/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def fetch(host : str, slug : str, api_key : str, application_key : str) -> List[


def create_headers(api_key : str, application_key : str) -> Headers:
return \
return\
{
'Accept': 'application/json',
'DD-API-KEY': api_key,
Expand Down
2 changes: 1 addition & 1 deletion chroma_feedback/producer/gitlab/gitlab/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def normalize_status(status : str) -> Status:

if status == 'skipped':
return 'skipped'
if status in ['created', 'running', 'pending']:
if status in [ 'created', 'running', 'pending' ]:
return 'started'
if status == 'canceled':
return 'errored'
Expand Down
2 changes: 1 addition & 1 deletion chroma_feedback/producer/jenkins/jenkins/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def normalize_status(result : str, is_building: bool) -> Status:

if is_building:
return 'started'
if result in ['unstable', 'not_build']:
if result in [ 'unstable', 'not_build' ]:
return 'errored'
if result == 'failure':
return 'failed'
Expand Down
2 changes: 1 addition & 1 deletion chroma_feedback/producer/microsoft/azure/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def normalize_status(status : str, result : str) -> Status:

if status == 'postponed':
return 'skipped'
if status in ['inprogress', 'notstarted']:
if status in [ 'inprogress', 'notstarted' ]:
return 'started'
if status == 'cancelling' or result == 'canceled':
return 'errored'
Expand Down
6 changes: 3 additions & 3 deletions chroma_feedback/producer/microsoft/github/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ def normalize_status(status : str, conclusion : str) -> Status:

if conclusion == 'skipped':
return 'skipped'
if status in ['in_progress', 'queued']:
if status in [ 'in_progress', 'queued' ]:
return 'started'
if conclusion in ['cancelled', 'stale']:
if conclusion in [ 'cancelled', 'stale' ]:
return 'errored'
if conclusion in ['action_required', 'timed_out']:
if conclusion in [ 'action_required', 'timed_out' ]:
return 'warned'
if conclusion == 'failure':
return 'failed'
Expand Down
4 changes: 2 additions & 2 deletions chroma_feedback/producer/travis/travis/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ def normalize_status(status : str, is_active : bool) -> Status:

if not is_active:
return 'skipped'
if status in ['created', 'started']:
if status in [ 'created', 'started' ]:
return 'started'
if status in ['cancelled', 'errored']:
if status in [ 'cancelled', 'errored' ]:
return 'errored'
if status == 'failed':
return 'failed'
Expand Down
8 changes: 4 additions & 4 deletions chroma_feedback/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def create_producer_report(producer_result : List[Producer]) -> List[ProducerRep
'url': result['url'],
'status': result['status']
})
if result['status'] in ['errored', 'warned', 'failed']:
if result['status'] in [ 'errored', 'warned', 'failed' ]:
report.append(
{
'name': result['name'],
Expand Down Expand Up @@ -59,7 +59,7 @@ def create_consumer_report(consumer_result : List[Consumer]) -> List[ConsumerRep
'message': wording.get('set_status').format(result['description'], result['status']),
'status': result['status']
})
if result['status'] in ['errored', 'warned', 'failed']:
if result['status'] in [ 'errored', 'warned', 'failed' ]:
report.append(
{
'name': result['name'],
Expand All @@ -74,9 +74,9 @@ def resolve_report_status(producer_report : List[ProducerReport]) -> Status:
status : Status = 'passed'

for report in producer_report:
if report['status'] == 'started' and status not in ['errored', 'warned', 'failed']:
if report['status'] == 'started' and status not in [ 'errored', 'warned', 'failed' ]:
status = 'started'
if report['status'] == 'errored' and status not in ['warned', 'failed']:
if report['status'] == 'errored' and status not in [ 'warned', 'failed' ]:
status = 'errored'
if report['status'] == 'warned' and status != 'failed':
status = 'warned'
Expand Down

0 comments on commit ae701d8

Please sign in to comment.