Conversation
| image_ext = tuple([".jpg", ".png", ".jpeg"]) | ||
| vid_ext = tuple([".mp4", ".mkv"]) | ||
| sticker_ext = tuple([".wepb", ".tgs"]) | ||
| song_ext = tuple([".mp3", ".wav", ".m4a"]) | ||
| image_ext = ".jpg", ".png", ".jpeg" | ||
| vid_ext = ".mp4", ".mkv" | ||
| sticker_ext = ".wepb", ".tgs" | ||
| song_ext = ".mp3", ".wav", ".m4a" |
There was a problem hiding this comment.
Lines 71-74 refactored with the following changes:
- Unwrap a constant iterable constructor. (
unwrap-iterable-construction)
| return bool(True) | ||
| return bool(True) if await is_chat_in_db(int(message.chat.id)) else bool(False) | ||
| return True | ||
| return bool(await is_chat_in_db(int(message.chat.id))) |
There was a problem hiding this comment.
Function is_harem_enabled refactored with the following changes:
- Remove unnecessary casts to int, str, float or bool (
remove-unnecessary-cast) - Simplify boolean if expression (
boolean-if-exp-identity)
| return bool(False) | ||
| return False | ||
| if not message.photo: | ||
| return bool(False) | ||
| return False | ||
| if not message.caption: | ||
| return bool(False) | ||
| return False | ||
| if "add" in message.caption.lower(): | ||
| return bool(True) | ||
| return bool(False) | ||
| return True | ||
| return False |
There was a problem hiding this comment.
Function harem_event refactored with the following changes:
- Remove unnecessary casts to int, str, float or bool (
remove-unnecessary-cast)
| "Stored the zip to `{}` in {} seconds.".format(downloaded_file_name, ms) | ||
| f"Stored the zip to `{downloaded_file_name}` in {ms} seconds." | ||
| ) | ||
|
|
There was a problem hiding this comment.
Function test refactored with the following changes:
- Replace call to format with f-string. (
use-fstring-for-formatting)
| if not result: | ||
| return None | ||
| return result.group(1) | ||
| return result[1] |
There was a problem hiding this comment.
Function find_between refactored with the following changes:
- Replace m.group(x) with m[x] for re.Match objects (
use-getitem-for-re-match-groups)
Sourcery Code Quality Report✅ Merging this PR will increase code quality in the affected files by 0.07%.
Here are some functions in these files that still need a tune-up:
Legend and ExplanationThe emojis denote the absolute quality of the code:
The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request. Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! Help us improve this quality report! |
Pull Request #11 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
unstablebranch, then run:Help us improve this pull request!