-
Notifications
You must be signed in to change notification settings - Fork 53
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
(test PR/ no need to review)NXDRIVE-2729: fix nuxeo drive folder icon on macos 11.4/11.5 (Sourcery refactored) #4057
Conversation
if document_type == self.doc_container_type: | ||
doc_type = None | ||
else: | ||
doc_type = document_type | ||
|
||
doc_type = None if document_type == self.doc_container_type else document_type |
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 Engine._direct_transfer
refactored with the following changes:
- Replace if statement with if expression (
assign-if-exp
)
doc_pair = get_state(transfer.doc_pair) | ||
if doc_pair: | ||
if doc_pair := get_state(transfer.doc_pair): |
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 Engine._resume_transfers
refactored with the following changes:
- Use named expression to simplify assignment and conditional (
use-named-expression
)
if not url.endswith("/"): | ||
return url + "/" | ||
return url | ||
return f"{url}/" if not url.endswith("/") else 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 Engine._normalize_url
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
) - Use f-string instead of string concatenation (
use-fstring-for-concatenation
)
if isinstance(force, bool): | ||
return force | ||
return False | ||
return force if isinstance(force, bool) else 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 Engine.local_rollback
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
)
row = self.dao.get_state_from_id(row_id) | ||
if row: | ||
if row := self.dao.get_state_from_id(row_id): |
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 Engine.resolve_with_local
refactored with the following changes:
- Use named expression to simplify assignment and conditional (
use-named-expression
)
row = self.dao.get_state_from_id(row_id) | ||
if row: | ||
if row := self.dao.get_state_from_id(row_id): |
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 Engine.resolve_with_remote
refactored with the following changes:
- Use named expression to simplify assignment and conditional (
use-named-expression
)
root_id = self.local.get_root_id() | ||
if root_id: | ||
if root_id := self.local.get_root_id(): |
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 Engine._check_fs
refactored with the following changes:
- Use named expression to simplify assignment and conditional (
use-named-expression
)
Sourcery AI seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## wip-NXDRIVE-2729-Fix-nuxeo-drive-folder-icon-on-macos-11.4/11.5 #4057 +/- ##
===================================================================================================
- Coverage 47.26% 46.97% -0.30%
===================================================================================================
Files 93 93
Lines 15651 15638 -13
===================================================================================================
- Hits 7398 7346 -52
- Misses 8253 8292 +39
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Pull Request #4056 refactored by Sourcery.
If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.
NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.
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
wip-NXDRIVE-2729-Fix-nuxeo-drive-folder-icon-on-macos-11.4/11.5
branch, then run:Help us improve this pull request!