-
-
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: command-regexp functions are now private #1944
Conversation
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 to ask: Are all of these changes really related to the PR/commit title, plugins: command-regexp functions are now private
? This is a rare occasion when I really think you're doing too much in one commit, unless all of the refactoring and such is truly necessary to do all at once. I'd say at least some of it probably isn't, and should be a separate commit or PR.
Two things about the overall approach here, though:
- The existing functions in
tools
should be marked deprecated until removal in 8.0, instead of yanked out in a point release with no warning. But nothing says we have to keep their implementation; what would you say to building the implementation insideRule
and its subclasses such that thosetools
functions would just call a classmethod or act as an accessor for the appropriate class constant? - Can we put
tools.compile_rule
intoplugins.rules
too? Same thing about deprecation vs. outright removal in 7.1, but it has no reason to exist outside the rule system especially if the rule system is its primary user.
I totally got carried away with that one, with a very bad case of tunnel vision. I'll see if I can separate that properly. |
868d4e8
to
1f4df30
Compare
Just did! I had to rebase everything, so I took that opportunity to fix the merge conflict as well. |
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.
Overall not a whole lot to say; mostly repeated suggestions for wording that's used in a half-dozen spots.
I complained about removing tests for the deprecated tools
functions, but there was no place to leave a line note about making them just call the corresponding plugins.rules
implementations until removal (what I suggested before).
463346b
to
e4cd829
Compare
@Exirel Pushed a couple commits to address my own feedback about test coverage and stuff. Instead of -0.1% coverage, the last PR build reported only -0.004%. 🏆 When it's time to straighten out the PR history, I suggest: |
I'm really not fan of your solution here: when something is deprecated, it's for a reason. This should not be modified, and there is only one way to ensure that: don't change the code. Now, if we want to change the code in, say, the regex we use for good, we'll have to take care of deprecated functions we don't want to change. |
These deprecated functions we don't want to change are meant to return the regex or pattern for the type of command they specify. The regex isn't going to change between now and 8.0, at which point these will be gone. But let's say we do want to change something. We'd have made that change in these functions before; now we make it in |
45641b8
to
17b5f0e
Compare
@dgw rebased, keeping your changes. Should be good now. |
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.
Extra tests for the regex args, too, it's magnificent!
And also proper import statements.
Co-authored-by: dgw <dgw@technobabbl.es>
Co-authored-by: dgw <dgw@technobabbl.es>
We don't need to bother adding tests now for the `action_command` ones, though. That is, unless someone's bored and wants to do it.
What it couldn't have in its prime, it now gets while on life support. Thank you for your service, `tools.get_action_command_regex()`.
17b5f0e
to
8174462
Compare
Rebase because I want to work on the next step asap. |
Description
Fix #1887
sopel.plugins.rules
, directly into each rule classsopel.test_tools
(this entire module should probably be deprecated and removed at some point anyway)sopel.test_tools
example
decorator runs a test (this should be transformed further, probably in a future PR, for 7.1 or 8.x)Checklist
make qa
(runsmake quality
andmake test
)