Skip to content

Sourcery refactored dev branch#1

Open
sourcery-ai[bot] wants to merge 1 commit into
devfrom
sourcery/dev
Open

Sourcery refactored dev branch#1
sourcery-ai[bot] wants to merge 1 commit into
devfrom
sourcery/dev

Conversation

@sourcery-ai
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot commented May 11, 2023

Branch dev refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the dev branch, then run:

git fetch origin sourcery/dev
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai Bot requested a review from dciborow May 11, 2023 07:22
Copy link
Copy Markdown
Author

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sourcery timed out performing refactorings.

Due to GitHub API limits, only the first 60 comments can be shown.

Comment on lines -77 to +80
logger.info("Deleting file: " + self.file_name)
logger.info(f"Deleting file: {self.file_name}")
os.remove(self.file_name)
else:
logger.info("File does not exist: " + self.file_name)
logger.info(f"File does not exist: {self.file_name}")
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function FileCache.clear refactored with the following changes:


def get_cache(name, max_age=DEFAULT_MAX_AGE, cache_dir=DEFAULT_CACHE_DIR):
file_name = os.path.join(cache_dir, name + '.json')
file_name = os.path.join(cache_dir, f'{name}.json')
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function get_cache refactored with the following changes:

pass

raise ValueError('Failed to decode file {} - unknown decoding'.format(file_path))
raise ValueError(f'Failed to decode file {file_path} - unknown decoding')
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function read_file_content refactored with the following changes:

Comment on lines -57 to +58
or (TRACE_ENV_VAR_COMPAT in os.environ and os.environ[TRACE_ENV_VAR_COMPAT] == 'true'):
print(request.method + ' ' + request.url)
or (TRACE_ENV_VAR_COMPAT in os.environ and os.environ[TRACE_ENV_VAR_COMPAT] == 'true'):
print(f'{request.method} {request.url}')
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Client._send_request refactored with the following changes:

Comment on lines -90 to +93
headers = {'Content-Type': media_type + '; charset=utf-8',
'Accept': accept_media_type + ';api-version=' + negotiated_version}
headers = {
'Content-Type': f'{media_type}; charset=utf-8',
'Accept': f'{accept_media_type};api-version={negotiated_version}',
}
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Client._send refactored with the following changes:

Comment on lines -146 to +143
if "callback" in kwargs:
callback = kwargs["callback"]
else:
callback = None
callback = kwargs.get("callback", None)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BuildClient.get_file refactored with the following changes:

Comment on lines -202 to +196
if "callback" in kwargs:
callback = kwargs["callback"]
else:
callback = None
callback = kwargs.get("callback", None)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BuildClient.get_attachment refactored with the following changes:

Comment on lines -706 to +697
if "callback" in kwargs:
callback = kwargs["callback"]
else:
callback = None
callback = kwargs.get("callback", None)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BuildClient.get_file_contents refactored with the following changes:

Comment on lines -992 to +980
if "callback" in kwargs:
callback = kwargs["callback"]
else:
callback = None
callback = kwargs.get("callback", None)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BuildClient.get_build_log refactored with the following changes:

Comment on lines -1062 to +1047
if "callback" in kwargs:
callback = kwargs["callback"]
else:
callback = None
callback = kwargs.get("callback", None)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BuildClient.get_build_logs_zip refactored with the following changes:

Comment on lines -1096 to +1078
if "callback" in kwargs:
callback = kwargs["callback"]
else:
callback = None
callback = kwargs.get("callback", None)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BuildClient.get_build_log_zip refactored with the following changes:

Comment on lines -1315 to +1294
if "callback" in kwargs:
callback = kwargs["callback"]
else:
callback = None
callback = kwargs.get("callback", None)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BuildClient.get_build_report_html_content refactored with the following changes:

callback = kwargs["callback"]
else:
callback = None
callback = kwargs.get("callback", None)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function FeedClient.get_badge refactored with the following changes:

callback = kwargs["callback"]
else:
callback = None
callback = kwargs.get("callback", None)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function GitClientBase.get_blob_content refactored with the following changes:

Comment on lines -164 to +161
if "callback" in kwargs:
callback = kwargs["callback"]
else:
callback = None
callback = kwargs.get("callback", None)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function GitClientBase.get_blobs_zip refactored with the following changes:

Comment on lines -133 to +127
if "callback" in kwargs:
callback = kwargs["callback"]
else:
callback = None
callback = kwargs.get("callback", None)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function NpmClient.get_readme_scoped_package refactored with the following changes:

Comment on lines -162 to +153
if "callback" in kwargs:
callback = kwargs["callback"]
else:
callback = None
callback = kwargs.get("callback", None)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function NpmClient.get_readme_unscoped_package refactored with the following changes:

callback = kwargs["callback"]
else:
callback = None
callback = kwargs.get("callback", None)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ReleaseClient.get_release_task_attachment_content refactored with the following changes:

Comment on lines -520 to +517
if "callback" in kwargs:
callback = kwargs["callback"]
else:
callback = None
callback = kwargs.get("callback", None)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ReleaseClient.get_logs refactored with the following changes:

Comment on lines -560 to +554
if "callback" in kwargs:
callback = kwargs["callback"]
else:
callback = None
callback = kwargs.get("callback", None)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ReleaseClient.get_task_log refactored with the following changes:

Comment on lines -785 to +776
if "callback" in kwargs:
callback = kwargs["callback"]
else:
callback = None
callback = kwargs.get("callback", None)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ReleaseClient.get_release_revision refactored with the following changes:

Comment on lines -853 to +841
if "callback" in kwargs:
callback = kwargs["callback"]
else:
callback = None
callback = kwargs.get("callback", None)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ReleaseClient.get_definition_revision refactored with the following changes:

callback = kwargs["callback"]
else:
callback = None
callback = kwargs.get("callback", None)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function TaskClient.create_attachment refactored with the following changes:

Comment on lines -194 to +191
if "callback" in kwargs:
callback = kwargs["callback"]
else:
callback = None
callback = kwargs.get("callback", None)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function TaskClient.get_attachment_content refactored with the following changes:

Comment on lines -247 to +241
if "callback" in kwargs:
callback = kwargs["callback"]
else:
callback = None
callback = kwargs.get("callback", None)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function TaskClient.append_log_content refactored with the following changes:

Comment on lines -420 to +417
if "callback" in kwargs:
callback = kwargs["callback"]
else:
callback = None
callback = kwargs.get("callback", None)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function TfvcClient.get_item_content refactored with the following changes:

Comment on lines -502 to +496
if "callback" in kwargs:
callback = kwargs["callback"]
else:
callback = None
callback = kwargs.get("callback", None)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function TfvcClient.get_item_text refactored with the following changes:

Comment on lines -550 to +541
if "callback" in kwargs:
callback = kwargs["callback"]
else:
callback = None
callback = kwargs.get("callback", None)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function TfvcClient.get_item_zip refactored with the following changes:

callback = kwargs["callback"]
else:
callback = None
callback = kwargs.get("callback", None)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function WikiClient.create_attachment refactored with the following changes:

Comment on lines -265 to +262
if "callback" in kwargs:
callback = kwargs["callback"]
else:
callback = None
callback = kwargs.get("callback", None)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function WikiClient.get_page_text refactored with the following changes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants