-
Notifications
You must be signed in to change notification settings - Fork 1
Sourcery Starbot ⭐ refactored falcorocks/piprot #1
base: master
Are you sure you want to change the base?
Conversation
if version: | ||
if verbose: | ||
if verbose: | ||
if version: | ||
print('{} ({}) isn\'t available on PyPI ' | ||
'anymore!'.format(requirement, version)) | ||
else: | ||
if verbose: | ||
else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function get_version_and_release_date
refactored with the following changes:
- Hoist conditional out of nested conditional (
hoist-if-from-if
) - Hoist repeated code outside conditional statement (
hoist-statement-from-if
)
total_time_delta = total_time_delta + time_delta | ||
total_time_delta += time_delta |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function main
refactored with the following changes:
- Remove redundant conditional (
remove-redundant-if
) - Replace assignment with augmented assignment (
aug-assign
)
if cli_args.quiet: | ||
verbose = False | ||
elif cli_args.verbatim: | ||
if cli_args.quiet or cli_args.verbatim: | ||
verbose = False | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function piprot
refactored with the following changes:
- Merge duplicate blocks in conditional (
merge-duplicate-blocks
) - Remove redundant conditional (
remove-redundant-if
)
if response.status_code == 200: | ||
api_response = json.loads(response.text) | ||
return api_response['default_branch'] | ||
else: | ||
if response.status_code != 200: | ||
return 'master' | ||
|
||
api_response = json.loads(response.text) | ||
return api_response['default_branch'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function get_default_branch
refactored with the following changes:
- Swap if/else branches (
swap-if-else-branches
) - Remove unnecessary else after guard condition (
remove-unnecessary-else
)
Thanks for starring sourcery-ai/sourcery ✨ 🌟 ✨
Here's your pull request refactoring your most popular Python repo.
If you want Sourcery to refactor all your Python repos and incoming pull requests install our bot.
Review changes via command line
To manually merge these changes, make sure you're on the
master
branch, then run: