-
Notifications
You must be signed in to change notification settings - Fork 1
Sourcery Starbot ⭐ refactored capdevc/jupyterlab_autoversion #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: main
Are you sure you want to change the base?
Conversation
print( | ||
"Installing jupyterlab_autoversion handler on path %s" | ||
% url_path_join(base_url, "autoversion") | ||
f'Installing jupyterlab_autoversion handler on path {url_path_join(base_url, "autoversion")}' | ||
) | ||
|
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 load_jupyter_server_extension
refactored with the following changes:
- Replace interpolated string formatting with f-string (
replace-interpolation-with-fstring
)
for line in fp: | ||
if ".autoversion" in line: | ||
add = False | ||
add = all(".autoversion" not in line for line in fp) |
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 initialize
refactored with the following changes:
- Use any() instead of for loop (
use-any
) - Invert any/all to simplify comparisons (
invert-any-all
)
return | ||
|
||
if not id and path: | ||
if not 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 GitGetHandler.get
refactored with the following changes:
- Remove redundant conditional (
remove-redundant-if
)
return | ||
|
||
if not id and path: | ||
if not 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 GitRestoreHandler.get
refactored with the following changes:
- Remove redundant conditional (
remove-redundant-if
) - Replace if statement with if expression (
assign-if-exp
)
|
||
m.web_app.settings = {} | ||
m.web_app.settings["base_url"] = "/test" | ||
m.web_app.settings = {"base_url": "/test"} |
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 TestExtension.test_load_jupyter_server_extension
refactored with the following changes:
- Merge dictionary assignment with declaration (
merge-dict-assign
)
return "" | ||
else: | ||
return 0 | ||
return "" if name == "path" else 0 |
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 TestExtension.test_git_restore
refactored with the following changes:
- Replace if statement with if expression [×3] (
assign-if-exp
)
Thanks for starring sourcery-ai/sourcery ✨ 🌟 ✨
Here's your pull request refactoring your most popular Python repo.
If you want Sourcery to refactor all your Python repos and incoming pull requests install our bot.
Review changes via command line
To manually merge these changes, make sure you're on the
main
branch, then run: