-
Notifications
You must be signed in to change notification settings - Fork 0
Sourcery refactored master branch #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| if ' ' in arg: | ||
| return '"%s"' % arg | ||
| return arg | ||
| return '"%s"' % arg if ' ' in arg else arg |
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 _python_cmd.quote refactored with the following changes:
- Lift code into else after jump in control flow (
reintroduce-else) - Replace if statement with if expression (
assign-if-exp)
| pkg_resources.require("distribute>="+version) | ||
| pkg_resources.require(f"distribute>={version}") |
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 use_setuptools refactored with the following changes:
- Use f-string instead of string concatenation (
use-fstring-for-concatenation)
| tgz_name = "distribute-%s.tar.gz" % version | ||
| tgz_name = f"distribute-{version}.tar.gz" |
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 download_setuptools refactored with the following changes:
- Replace interpolated string formatting with f-string (
replace-interpolation-with-fstring)
| new_name = path + '.OLD.%s' % time.time() | ||
| new_name = path + f'.OLD.{time.time()}' |
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 _rename_path refactored with the following changes:
- Replace interpolated string formatting with f-string (
replace-interpolation-with-fstring)
| pyver = '%s.%s' % (sys.version_info[0], sys.version_info[1]) | ||
| setuptools_file = 'setuptools-%s-py%s.egg-info' % \ | ||
| (SETUPTOOLS_FAKED_VERSION, pyver) | ||
| pyver = f'{sys.version_info[0]}.{sys.version_info[1]}' | ||
| setuptools_file = f'setuptools-{SETUPTOOLS_FAKED_VERSION}-py{pyver}.egg-info' |
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 _create_fake_setuptools_pkg_info refactored with the following changes:
- Replace interpolated string formatting with f-string (
replace-interpolation-with-fstring)
| if arg.startswith('%s=' % option): | ||
| if arg.startswith(f'{option}='): |
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 _under_prefix refactored with the following changes:
- Replace interpolated string formatting with f-string (
replace-interpolation-with-fstring)
| if not res: | ||
| return |
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 _fake_setuptools refactored with the following changes:
- Hoist repeated code outside conditional statement (
hoist-statement-from-if)
| @@ -22,6 +22,7 @@ | |||
|
|
|||
| """Identify (and optionally delete) stale Delicious and Pinboard links""" | |||
|
|
|||
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.
Lines 40-40 refactored with the following changes:
- Replace interpolated string formatting with f-string (
replace-interpolation-with-fstring)
| url = "%s/%s?%s" % (PINBOARD_API, path, urllib.urlencode(params)) | ||
| url = f"{PINBOARD_API}/{path}?{urllib.urlencode(params)}" | ||
| else: | ||
| url = "%s/%s" % (PINBOARD_API, path) | ||
| url = f"{PINBOARD_API}/{path}" | ||
|
|
||
| if pydelicious.DEBUG: print >>sys.stderr, \ | ||
| "pinboard_api_request: %s" % url | ||
| if pydelicious.DEBUG: | ||
| (print >>sys.stderr, f"pinboard_api_request: {url}") |
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 pinboard_api_request refactored with the following changes:
- Replace interpolated string formatting with f-string (
replace-interpolation-with-fstring)
| return url[0:hash_position] | ||
| return url[:hash_position] |
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 sanitize_url refactored with the following changes:
- Replace a[0:x] with a[:x] and a[x:len(a)] with a[x:] (
remove-redundant-slice-index)
Branch
masterrefactored 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
masterbranch, then run:Help us improve this pull request!