-
Notifications
You must be signed in to change notification settings - Fork 137
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
Generalize String criteria matching #471
base: master
Are you sure you want to change the base?
Conversation
I included the operator Originally I was thinking this could replace the 'spec' definitions, but didn't dig deep enough to see if this is the case or not... |
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.
Thanks for the patch! Sorry I took way too much time to get back to this.
I think it's a bit confusing to introduce all of these new operators, but only support them on strings. For instance truthy/falsy are not supported on booleans.
Maybe operators could be introduced incrementally on all types they make sense, starting with e.g. regexp which only makes sense on strings.
@@ -11,6 +11,14 @@ | |||
struct mako_config; | |||
struct mako_notification; | |||
|
|||
enum operator { OP_NONE, OP_EQUALS, OP_REGEX_MATCHES, OP_NOT_EQUALS, OP_TRUTHY, OP_FALSEY }; | |||
|
|||
struct mako_condition { |
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.
This is specific to strings, maybe should be renamed to e.g. struct mako_string_criteria
?
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 think I was originally thinking that mako_condition could be used for all of the conditions (and maybe there are other operators that other types of conditions could use, like "in" or "less than"/"greater than" for urgency, group-index).
Since this PR is "Generalize String criteria matching", I didn't want to go too far out of scope and refactor all of the conditions.
But I'm not too invested in this, so if you really want the rename, I will probably do it.
7a510ed
to
f2ea430
Compare
Closes #306
Most string fields have been changed to support
[app-name~=D..o]
[summary!=""]
[summary]
(equivalent to[summary!=""]
)[!summary]
(equivalent to[summary=""]
)