-
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
NXDRIVE-2860: Code Coverage (Sourcery refactored) #4356
base: wip-NXDRIVE-2860-Code-Coverage
Are you sure you want to change the base?
NXDRIVE-2860: Code Coverage (Sourcery refactored) #4356
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. |
1 similar comment
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. |
a14c340
to
a7f5b21
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## wip-NXDRIVE-2860-Code-Coverage #4356 +/- ##
==================================================================
- Coverage 53.18% 52.95% -0.24%
==================================================================
Files 94 94
Lines 15683 15682 -1
==================================================================
- Hits 8341 8304 -37
- Misses 7342 7378 +36
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
7298f5d
to
c46c79b
Compare
0166544
to
c2f689b
Compare
cc9967f
to
5de2ac2
Compare
c2f689b
to
e6bf9dd
Compare
5de2ac2
to
89902b3
Compare
e6bf9dd
to
22092a6
Compare
89902b3
to
fcd87de
Compare
22092a6
to
c654de0
Compare
c654de0
to
69dd2ac
Compare
90e89a6
to
91c58c6
Compare
e3eba68
to
72d7aae
Compare
72d7aae
to
397a794
Compare
return bool(status[0] == "ok") | ||
return status[0] == "ok" |
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 is_healthy
refactored with the following changes:
- Remove unnecessary casts to int, str, float or bool (
remove-unnecessary-cast
)
try: | ||
self._execute() | ||
except ThreadInterrupt: | ||
log.debug("Thread INTERRUPT") | ||
except Exception: | ||
log.exception("Thread EXCEPTION") | ||
self._execute() | ||
except ThreadInterrupt: | ||
log.debug("Thread INTERRUPT") | ||
except Exception: | ||
log.exception("Thread EXCEPTION") |
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 Worker.run
refactored with the following changes:
- Merge nested try-statement into a single try (
flatten-nested-try
)
input_obj = "doc:" + doc_path | ||
input_obj = f"doc:{doc_path}" |
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 TwoUsersTest._set_read_permission
refactored with the following changes:
- Use f-string instead of string concatenation (
use-fstring-for-concatenation
)
input_obj = "doc:" + doc_path | ||
input_obj = f"doc:{doc_path}" |
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 TwoUsersTest.set_readonly
refactored with the following changes:
- Use f-string instead of string concatenation (
use-fstring-for-concatenation
)
assert remote.get_info("/" + filename).name == filename | ||
assert remote.get_info(f"/{filename}").name == filename |
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 TestEncoding.test_name_normalization
refactored with the following changes:
- Use f-string instead of string concatenation (
use-fstring-for-concatenation
)
fs_item_id = FS_ITEM_ID_PREFIX + "fakeId" | ||
fs_item_id = f"{FS_ITEM_ID_PREFIX}fakeId" |
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 TestRemoteFileSystemClient.test_get_fs_info
refactored with the following changes:
- Use f-string instead of string concatenation (
use-fstring-for-concatenation
)
partial_descendants = scroll_res["descendants"] | ||
if not partial_descendants: | ||
if partial_descendants := scroll_res["descendants"]: | ||
descendants.extend(partial_descendants) | ||
else: | ||
break | ||
descendants.extend(partial_descendants) |
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 TestRemoteFileSystemClient.test_scroll_descendants
refactored with the following changes:
- Use named expression to simplify assignment and conditional (
use-named-expression
) - Lift code into else after jump in control flow (
reintroduce-else
) - Swap if/else branches (
swap-if-else-branches
)
fs_item_id = FS_ITEM_ID_PREFIX + "fakeId" | ||
fs_item_id = f"{FS_ITEM_ID_PREFIX}fakeId" |
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 TestRemoteFileSystemClient.test_exists
refactored with the following changes:
- Use f-string instead of string concatenation (
use-fstring-for-concatenation
)
fs_item_id = FS_ITEM_ID_PREFIX + "fakeId" | ||
fs_item_id = f"{FS_ITEM_ID_PREFIX}fakeId" |
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 TestRemoteFileSystemClient.test_get_fs_item
refactored with the following changes:
- Use f-string instead of string concatenation (
use-fstring-for-concatenation
)
total = len(self.make_server_tree()) | ||
# Add the workspace folder + the root | ||
total += 2 | ||
total = len(self.make_server_tree()) + 2 |
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 TestWatchers.test_remote_scan
refactored with the following changes:
- Replace assignment and augmented assignment with single assignment (
merge-assign-and-aug-assign
)
This removes the following comments ( why? ):
# Add the workspace folder + the root
Pull Request #4354 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-2860-Code-Coverage
branch, then run:Help us improve this pull request!