-
Notifications
You must be signed in to change notification settings - Fork 219
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 #4
base: master
Are you sure you want to change the base?
Conversation
class Config(): | ||
|
||
|
||
class Config: |
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 3-27
refactored with the following changes:
- Replace list(), dict() or set() with comprehension (
collection-builtin-to-comprehension
)
update_channel = UPDATES_CHANNEL | ||
if update_channel: | ||
if update_channel := UPDATES_CHANNEL: |
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 _start
refactored with the following changes:
- Use named expression to simplify assignment and conditional (
use-named-expression
)
update_channel = UPDATES_CHANNEL | ||
if update_channel: | ||
if update_channel := UPDATES_CHANNEL: |
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 _help
refactored with the following changes:
- Use named expression to simplify assignment and conditional (
use-named-expression
)
if(pos==1): | ||
button = [ | ||
[InlineKeyboardButton(text = '-->', callback_data = "help+2")] | ||
] | ||
elif(pos==len(tr.HELP_MSG)-1): | ||
button = [ | ||
[InlineKeyboardButton(text = '<--', callback_data = f"help+{pos-1}")] | ||
if (pos==1): | ||
return [[InlineKeyboardButton(text='-->', callback_data="help+2")]] | ||
elif (pos==len(tr.HELP_MSG)-1): | ||
return [ | ||
[InlineKeyboardButton(text='<--', callback_data=f"help+{pos-1}")] | ||
] | ||
else: | ||
button = [ | ||
return [ | ||
[ | ||
InlineKeyboardButton(text = '<--', callback_data = f"help+{pos-1}"), | ||
InlineKeyboardButton(text = '-->', callback_data = f"help+{pos+1}") | ||
InlineKeyboardButton( | ||
text='<--', callback_data=f"help+{pos-1}" | ||
), | ||
InlineKeyboardButton( | ||
text='-->', callback_data=f"help+{pos+1}" | ||
), | ||
], | ||
] | ||
return button |
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 map
refactored with the following changes:
- Lift return into if (
lift-return-into-if
)
print(str(e)) No newline at end of file | ||
print(e) |
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 21-21
refactored with the following changes:
- Remove unnecessary call to
str()
withinprint()
(remove-str-from-print
)
rem = SESSION.query(forceSubscribe).get(chat_id) | ||
if rem: | ||
if rem := SESSION.query(forceSubscribe).get(chat_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 disapprove
refactored with the following changes:
- Use named expression to simplify assignment and conditional (
use-named-expression
)
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:Help us improve this pull request!