-
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
2711-Testcase-fix (Sourcery refactored) #4299
2711-Testcase-fix (Sourcery refactored) #4299
Conversation
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 ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## wip-NXDRIVE-Testcase-fix-2711 #4299 +/- ##
=================================================================
- Coverage 47.79% 47.77% -0.02%
=================================================================
Files 94 94
Lines 15678 15673 -5
=================================================================
- Hits 7493 7488 -5
Misses 8185 8185
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
0e5376e
to
f1185b4
Compare
f1185b4
to
0c8e0fa
Compare
for engine in self.manager.engines.copy().values(): | ||
if engine.remote: | ||
return engine.remote.client.server_version # type: ignore | ||
return None | ||
return next( | ||
( | ||
engine.remote.client.server_version | ||
for engine in self.manager.engines.copy().values() | ||
if engine.remote | ||
), | ||
None, | ||
) |
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.
if exc.errno in NO_SPACE_ERRORS: | ||
log.warning("Update failed, disk space needed", exc_info=True) | ||
self.noSpaceLeftOnDevice.emit() | ||
else: | ||
if exc.errno not in NO_SPACE_ERRORS: | ||
raise | ||
log.warning("Update failed, disk space needed", exc_info=True) | ||
self.noSpaceLeftOnDevice.emit() |
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 BaseUpdater.update
refactored with the following changes:
- Swap if/else branches (
swap-if-else-branches
) - Remove unnecessary else after guard condition (
remove-unnecessary-else
)
path = os.path.join(gettempdir(), uuid.uuid4().hex + "_" + name) | ||
path = os.path.join(gettempdir(), f"{uuid.uuid4().hex}_{name}") |
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 BaseUpdater._download
refactored with the following changes:
- Use f-string instead of string concatenation [×2] (
use-fstring-for-concatenation
)
versions = { | ||
if versions := { | ||
version: info | ||
for version, info in self.versions.items() | ||
if info.get("type", "").lower() | ||
in (self.manager.get_update_channel(), "release") | ||
and version_lt(version, "4") | ||
} | ||
if versions: | ||
}: |
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 BaseUpdater.force_downgrade
refactored with the following changes:
- Use named expression to simplify assignment and conditional (
use-named-expression
)
info = self.versions.get(version) | ||
if info: | ||
if info := self.versions.get(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 BaseUpdater.get_version_channel
refactored with the following changes:
- Use named expression to simplify assignment and conditional (
use-named-expression
)
Pull Request #4298 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-Testcase-fix-2711
branch, then run:Help us improve this pull request!