From ae701d89dbdc2c581fbe5c50981cf2d535e84ec7 Mon Sep 17 00:00:00 2001 From: henryruhs Date: Fri, 10 May 2024 09:37:02 +0200 Subject: [PATCH] Adjust coding style --- LICENSE.md | 2 +- chroma_feedback/producer/appveyor/appveyor/normalize.py | 4 ++-- chroma_feedback/producer/atlassian/bitbucket/normalize.py | 2 +- chroma_feedback/producer/circle/circle/core.py | 2 +- chroma_feedback/producer/circle/circle/normalize.py | 4 ++-- chroma_feedback/producer/cloudbees/codeship/normalize.py | 6 +++--- chroma_feedback/producer/datadog/datadog/core.py | 2 +- chroma_feedback/producer/gitlab/gitlab/normalize.py | 2 +- chroma_feedback/producer/jenkins/jenkins/normalize.py | 2 +- chroma_feedback/producer/microsoft/azure/normalize.py | 2 +- chroma_feedback/producer/microsoft/github/normalize.py | 6 +++--- chroma_feedback/producer/travis/travis/normalize.py | 4 ++-- chroma_feedback/reporter.py | 8 ++++---- 13 files changed, 23 insertions(+), 23 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index a93bed3f..aae2360e 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,3 +1,3 @@ MIT license -Copyright (c) 2023 Henry Ruhs +Copyright (c) 2024 Henry Ruhs diff --git a/chroma_feedback/producer/appveyor/appveyor/normalize.py b/chroma_feedback/producer/appveyor/appveyor/normalize.py index 91af6c8f..a54b717d 100644 --- a/chroma_feedback/producer/appveyor/appveyor/normalize.py +++ b/chroma_feedback/producer/appveyor/appveyor/normalize.py @@ -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' diff --git a/chroma_feedback/producer/atlassian/bitbucket/normalize.py b/chroma_feedback/producer/atlassian/bitbucket/normalize.py index 9c5381c0..2404c907 100644 --- a/chroma_feedback/producer/atlassian/bitbucket/normalize.py +++ b/chroma_feedback/producer/atlassian/bitbucket/normalize.py @@ -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' diff --git a/chroma_feedback/producer/circle/circle/core.py b/chroma_feedback/producer/circle/circle/core.py index 7f4f629a..3c997248 100644 --- a/chroma_feedback/producer/circle/circle/core.py +++ b/chroma_feedback/producer/circle/circle/core.py @@ -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 diff --git a/chroma_feedback/producer/circle/circle/normalize.py b/chroma_feedback/producer/circle/circle/normalize.py index e99c6bf3..dc62fcd9 100644 --- a/chroma_feedback/producer/circle/circle/normalize.py +++ b/chroma_feedback/producer/circle/circle/normalize.py @@ -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' diff --git a/chroma_feedback/producer/cloudbees/codeship/normalize.py b/chroma_feedback/producer/cloudbees/codeship/normalize.py index d846c652..5bc09e1a 100644 --- a/chroma_feedback/producer/cloudbees/codeship/normalize.py +++ b/chroma_feedback/producer/cloudbees/codeship/normalize.py @@ -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' diff --git a/chroma_feedback/producer/datadog/datadog/core.py b/chroma_feedback/producer/datadog/datadog/core.py index 269e3564..8f7bdbb1 100644 --- a/chroma_feedback/producer/datadog/datadog/core.py +++ b/chroma_feedback/producer/datadog/datadog/core.py @@ -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, diff --git a/chroma_feedback/producer/gitlab/gitlab/normalize.py b/chroma_feedback/producer/gitlab/gitlab/normalize.py index fd4d3554..0db06d45 100644 --- a/chroma_feedback/producer/gitlab/gitlab/normalize.py +++ b/chroma_feedback/producer/gitlab/gitlab/normalize.py @@ -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' diff --git a/chroma_feedback/producer/jenkins/jenkins/normalize.py b/chroma_feedback/producer/jenkins/jenkins/normalize.py index 218ece44..a84cde0c 100644 --- a/chroma_feedback/producer/jenkins/jenkins/normalize.py +++ b/chroma_feedback/producer/jenkins/jenkins/normalize.py @@ -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' diff --git a/chroma_feedback/producer/microsoft/azure/normalize.py b/chroma_feedback/producer/microsoft/azure/normalize.py index 21e6d323..65368482 100644 --- a/chroma_feedback/producer/microsoft/azure/normalize.py +++ b/chroma_feedback/producer/microsoft/azure/normalize.py @@ -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' diff --git a/chroma_feedback/producer/microsoft/github/normalize.py b/chroma_feedback/producer/microsoft/github/normalize.py index 29ce65eb..a0aad165 100644 --- a/chroma_feedback/producer/microsoft/github/normalize.py +++ b/chroma_feedback/producer/microsoft/github/normalize.py @@ -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' diff --git a/chroma_feedback/producer/travis/travis/normalize.py b/chroma_feedback/producer/travis/travis/normalize.py index 5c706c5d..63d0ba0e 100644 --- a/chroma_feedback/producer/travis/travis/normalize.py +++ b/chroma_feedback/producer/travis/travis/normalize.py @@ -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' diff --git a/chroma_feedback/reporter.py b/chroma_feedback/reporter.py index 63e4062a..7f70dfcd 100644 --- a/chroma_feedback/reporter.py +++ b/chroma_feedback/reporter.py @@ -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'], @@ -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'], @@ -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'