-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
plugins: check consistency of plugin code and their output formatting #1937
Conversation
This pull request introduces 1 alert when merging b4961a8 into 528e1b8 - view on LGTM.com new alerts:
|
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.
I have a vested interest in getting this done and merged soon, since I built another PR on top of it to save on rebasing work later. So I hope you'll not be too annoyed by my suggestions here, and we can get this whipped into shape faster than that interminable plugin-chapter doc PR we just finished. 😹
Whoops, forgot to check LGTM's comment before submitting that review. It has a point. |
This pull request introduces 1 alert when merging 0b471de into 58bd737 - view on LGTM.com new alerts:
|
I'll hate the squash & rebase that will come. And all the potential merge conflict to come. Oh well, it has to be done. @dgw waiting on your approval. |
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.
Once I managed to coax a "changes since last review" view out of GitHub (only accessible from the Conversation tab, for some reason; the Files tab dropdown had that option greyed out), this was a pretty easy re-review. Just a couple little things, and one additional can of worms opened accidentally by the added tweaks to those few command docstrings that started with """.
… 😅
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.
Between the last little tweaks and the follow-up items added to my to-do list, this should be good to go. Squash when ready!
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.
Only looked at currency, but LGTM 👍
@Duckle29 thanks for the extra eyes! 🙌 |
* replaced `sopel.module` by `sopel.plugin` * replaced `reply` by `say` in private message only commands
* replaced `sopel.module` by `sopel.plugin` * replaced duplicated text by a constant * replaced `return bot.reply` by 2 lines Note: `bot.reply`'s return has no meaning. Using it in a return statement creates confusion as to why it is used in such a way. Therefore, it should **not** be used that way.
* replaced `sopel.module` by `sopel.plugin` * added output prefix
* replaced `sopel.module` by `sopel.plugin` * used output prefix with `bot.say` * removed obsolete "if main" block
* replaced `sopel.module` by `sopel.plugin` * removed obsolete "if main" block
* replaced `sopel.module` by `sopel.plugin` * used output prefix with `bot.say` * replaced common error messages by constants
* replaced `sopel.module` by `sopel.plugin` * used output prefix with `bot.say`
* replaced `sopel.module` by `sopel.plugin` * used output prefix with `bot.say` * removed `return plugin.NOLIMIT` from `exchange` function as this return value is not used by its callers
* replaced `sopel.module` by `sopel.plugin` * used output prefix with `bot.say` * removed obsolete "if main" block
* replaced `sopel.module` by `sopel.plugin` * no output prefix for emotes, they are too pure!
* replaced `sopel.module` by `sopel.plugin`
* replaced `sopel.module` by `sopel.plugin` * add manual output prefix in job
* replaced `sopel.module` by `sopel.plugin` * used `plugin.output_prefix` with `bot.say` method * replaced `Likes: N` by `N ♥`` with proper singular/plural * replaced `Comments: N` by `N comment` with proper singular/plural
* replaced `sopel.module` by `sopel.plugin` * replaced `return bot.reply` by 2 lines
* replaced `sopel.module` by `sopel.plugin` * replaced `bot.say` by `bot.reply` for error cases * replaced `return bot.reply` by 2 lines * removed obsolete `if main` block
* replaced `sopel.module` by `sopel.plugin` * removed obsolete `if main` block
* replaced `sopel.module` by `sopel.plugin` * removed obsolete `if main` block
* replaced `sopel.module` by `sopel.plugin` * replaced `bot.say` by `bot.reply` for error cases * replaced `return bot.reply` by 2 lines * used `plugin.output_prefix` with `bot.say` method
* replaced `sopel.module` by `sopel.plugin` * replaced `bot.say` by `bot.reply` for error cases * replaced `return bot.reply` by 2 lines * used `plugin.output_prefix` with `bot.say` method
* replaced `sopel.module` by `sopel.plugin` Note: I didn't use bot.say as .in and .at inform the user that their action succeeded *for them*. It's a very specific case and I didn't feel like using `bot.say` here.
* replaced `sopel.module` by `sopel.plugin` * used `plugin.output_prefix` with `bot.say` method
* replaced `sopel.module` by `sopel.plugin` * replaced `return bot.reply` by 2 lines * used `plugin.output_prefix` with `bot.say` method
* replaced `sopel.module` by `sopel.plugin` * used `plugin.output_prefix` with `bot.say` method
* replaced `sopel.module` by `sopel.plugin` * replaced `return bot.reply` by 2 lines * used `plugin.output_prefix` with `bot.say` method
* replaced `sopel.module` by `sopel.plugin` * used `plugin.output_prefix` with `bot.say` method Note: apparently TLD parsing is broken. This won't fix it.
* replaced `sopel.module` by `sopel.plugin` * replaced `return bot.reply` by 2 lines * used `plugin.output_prefix` with `bot.say` method
* replaced `sopel.module` by `sopel.plugin` * used `plugin.output_prefix` with `bot.say` method * removed obsolete `if main` block
* replaced `sopel.module` by `sopel.plugin` * used `plugin.output_prefix` with `bot.say` method * removed obsolete `if main` block
* replaced `sopel.module` by `sopel.plugin` * used `plugin.output_prefix` with `bot.say` method
* replaced `sopel.module` by `sopel.plugin` * used `plugin.output_prefix` with `bot.say` method * removed obsolete `if main` block
* replaced `sopel.module` by `sopel.plugin` * used `plugin.output_prefix` with `bot.say` method
* replaced `sopel.module` by `sopel.plugin` * used `plugin.output_prefix` with `bot.say` method
* replaced `sopel.module` by `sopel.plugin` * used `plugin.output_prefix` with `bot.say` method
* replaced `sopel.module` by `sopel.plugin` * used `plugin.output_prefix` with `bot.say` method And in theory, I'm done!
18bf093
to
ce5cf44
Compare
Squashed, rebased: 🚢 |
In the end, this was a lie, since you did touch it after all. 😹
But saying this motivated someone else (me) to work on it, with a PR coming Soon™ to a repo near you! (Pro tip: It was a lot less complicated to just rewrite the whole thing with a different strategy than to fix the regex. 😁) |
reddit: remove stray hard-coded message prefix missed in #1937
Description
I'm trying to fix, at least partially, issue #709 which turned out differently than what I expected.
So in the end, I also checked the code's consistency, and decided to:
bot.reply
in case of errorif main
block (they are pointless)sopel.module
bysopel.plugin
; we know it works, it's fine, let's move on with our lifereturn bot.reply
statement because a one-liner that makes no sense is harmful to beginner who might not understand what we are trying to achieve with it; also the code should express the intent, it is not a showcase of how smart you are at reducing the file length (mood: 😠)from sopel import plugin
instead of anything else)completely ignoreeventually did themeetbot
plugin, and that one can go 🇫🇷 🤬 itselftld
plugin, it looks complicated and I hate it—go read on Wikipedia you lazy nerd!If anyone complain or have comments or suggestion: this PR is here to fix #709 so you too can help, so please do!
Checklist
make qa
(runsmake quality
andmake test
)