Skip to content
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

rules: add find and search rules #1881

Merged
merged 3 commits into from
Jun 16, 2020
Merged

Conversation

Exirel
Copy link
Contributor

@Exirel Exirel commented Jun 1, 2020

Fixes #1757

Draft PR for now, until #1873 is at least approved.

Description

Based on #1873 this PR adds two new rules:

  • Find rules: an anonymous rule that executes its handler for every instance found in the line, allowing to execute a function multiple times for a single trigger object
  • Search rules: an anonymous rule that works like the original rule, but matches from anywhere in the line, allowing to execute a function exactly once on any word or pattern contained within a line, not just from its beginning

Checklist

  • I have read CONTRIBUTING.md
  • I can and do license this contribution under the EFLv2
  • No issues are reported by make qa (runs make quality and make test)
  • I have tested the functionality of the things this change touches

@Exirel Exirel added this to the 7.1.0 milestone Jun 1, 2020
@Exirel Exirel changed the title Core search based rules rules: add find and search rules Jun 1, 2020
@lgtm-com

This comment has been minimized.

@Exirel Exirel force-pushed the core-search-based-rules branch from 92f166f to 460c6f2 Compare June 2, 2020 09:57
@lgtm-com

This comment has been minimized.

@Exirel Exirel force-pushed the core-search-based-rules branch from 460c6f2 to da186d6 Compare June 6, 2020 17:32
@lgtm-com

This comment has been minimized.

@Exirel Exirel force-pushed the core-search-based-rules branch from da186d6 to 5d0f935 Compare June 10, 2020 07:07
@lgtm-com

This comment has been minimized.

@dgw dgw force-pushed the core-search-based-rules branch from 5d0f935 to 161a90a Compare June 11, 2020 19:23
@dgw
Copy link
Member

dgw commented Jun 11, 2020

Rebased on your behalf, @Exirel. Look over it and mark ready for review if you're satisfied!

@Exirel
Copy link
Contributor Author

Exirel commented Jun 11, 2020

Hmmmm not a huge fan of the rebase yourself, because it tends to mess with my local working copy when I pull. :(

@Exirel Exirel marked this pull request as ready for review June 11, 2020 22:02
@Exirel Exirel force-pushed the core-search-based-rules branch from 161a90a to 65fb76a Compare June 11, 2020 22:47
@Exirel Exirel requested a review from dgw June 11, 2020 22:47
@Exirel
Copy link
Contributor Author

Exirel commented Jun 11, 2020

Re-signed & ready for review!

Copy link
Member

@dgw dgw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just little things. The tests prove that this (should) work as intended, so I focused on making sure the documentation was clear for plugin authors.

Co-authored-by: dgw <dgw@technobabbl.es>
Copy link
Member

@dgw dgw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, do we get to squash the docstring fixes in with the original changes, or is that a pain? x)

@Exirel
Copy link
Contributor Author

Exirel commented Jun 16, 2020

Pain. It is.

@dgw
Copy link
Member

dgw commented Jun 16, 2020

In that case: Merge. It is.

@dgw dgw merged commit b5a5268 into sopel-irc:master Jun 16, 2020
@Exirel Exirel deleted the core-search-based-rules branch June 23, 2020 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rule cannot match multiple times in one line
2 participants