-
Notifications
You must be signed in to change notification settings - Fork 0
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
Sourcery refactored master branch #3
base: master
Are you sure you want to change the base?
Conversation
|
params = {} | ||
params['userId'] = userId | ||
params['labelIds'] = labelIds | ||
params['q'] = q | ||
params['pageToken'] = pageToken | ||
params['maxResults'] = maxResults | ||
params['includeSpamTrash'] = includeSpamTrash | ||
params['fields'] = fields | ||
params = { | ||
'userId': userId, | ||
'labelIds': labelIds, | ||
'q': q, | ||
'pageToken': pageToken, | ||
'maxResults': maxResults, | ||
'includeSpamTrash': includeSpamTrash, | ||
'fields': fields, | ||
} | ||
|
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 GmailApp.searchMessages
refactored with the following changes:
- Merge dictionary assignment with declaration (
merge-dict-assign
)
body = {} | ||
body['ids'] = ids | ||
body = {'ids': ids} |
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 GmailApp.deleteMessages
refactored with the following changes:
- Merge dictionary assignment with declaration (
merge-dict-assign
)
logging.info('Done.') | ||
else: | ||
logging.info(args.server + ' not found.') | ||
logging.info('Done.') | ||
|
||
logging.info('Done.') |
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 128-131
refactored with the following changes:
- Hoist repeated code outside conditional statement (
hoist-statement-from-if
)
if ask == 'y' or ask == 'Y' or ask == 'yes': | ||
if ask in ['y', 'Y', 'yes']: | ||
DOCKER_HUB_USERNAME = input('Username ? ') | ||
DOCKER_HUB_PASSWORD = input('Password ? ') | ||
else: | ||
return 'undefined (Private repository ?)' | ||
|
||
r = get_request(url, jwt_auth=True, token=get_docker_token()) | ||
if 'results' not in r: | ||
logging.error('Invalid password or username, by pass') | ||
return 'undefined' | ||
if 'results' not in r: | ||
logging.error('Invalid password or username, by pass') | ||
return 'undefined' |
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_last_tag
refactored with the following changes:
- Hoist conditional out of nested conditional (
hoist-if-from-if
) - Replace multiple comparisons of same variable with
in
operator (merge-comparisons
)
Sourcery Code Quality Report (beta)✅ Merging this PR will increase code quality in the affected files by 0.05 out of 10.
Here are some functions in these files that still need a tune-up:
Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! |
Branch
master
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
master
branch, then run: