-
Notifications
You must be signed in to change notification settings - Fork 58
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
Support for anything-but/ignore-case #71
Conversation
Putting in draft until the issue and proposed syntax is reviewed |
Heads down on something this week. I'll be slow in replying. I'm unsure if |
@baldawar -- the machine I'm on won't let me update the description, so I'll update the comments when I get on another machine. If you have a sec for feedback, I'd appreciate it! |
updated benchmarks and usage comments |
Thanks. I'll review this on Thursday (02/09). It wasn't obvious from the tests but if the implementation was a generic |
The PR's implementation is very much specific to anything-but (and not even anything-but/suffix, anything-but/prefix). I'm happy to open an issue unless you'd prefer a core team member to do the analysis? |
README.md
Outdated
```javascript | ||
{ | ||
"detail": { | ||
"state": [ { "anything-but": {"ignore-case": [ "Stopped", "OverLoaded" ] } } ] |
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 didn't spot this earlier but this is different than the existing equals-ignore-case
. While I'm on the fence, I think I still prefer using it over creating a new matcher. It's just weird that we'll have this one matcher that works with single value but then with arrays when use in conjunction with anything-but.
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.
agreed, the one-off equals-ignore-case
was the original motivation for the creating anything-but-ignore-case
... Definitely flexible with this as it has impact for your forward looking vision.
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.
Until Tim & Shawn object by Monday (Shawn is away this week), I'd favor going equals-ignore-case
over ignore-case
. Definitely will check back by monday EOD.
On a high-level, this looks disconnected with rest of ruler's features. I think it'd be great if it creates some similarities with I'm also uncomfortable with the level of complexity AnythingBut is adding within the classes. Its ripe for refactoring, but I'd like that to be initiated only after we're aligned on functionality. |
Single-values are allowed (is reuses the parser for anything-but): |
Fair! If anything-but itself needs to be re-written, I'll happily close this PR. Just let me know. It is helpful for my product, but not 100% mandatory yet. |
If you see it as significant re-write, then definitely don't do it. I'd rather merge the PR as is. Even without considering the unintended time-investment it'll trigger, the coupling of the big rewrites w small feature isn't worth it. Also, still want to make sure there's no objections on Hoping waiting till Monday isn't an issue. Let me know if that's an incorrect assumption. |
Sounds great! This whole thing has been pretty quick and painless so I'm up for a few more small changes. I can't really commit to help a lot on refactoring the state-machines (which I think would be necessary to really make anything-but less complicated) given all the oddness in existing behavior around applying multiple to a single field. (the ones I mentioned on #69 ) |
This is a 5 minute search and replace so I'll go ahead and change the syntax to equals-ignore-case and will change it back if you get dissenters. |
Hi @baldawar! Anything further on this PR? |
Sorry for not getting to this sooner. Just having a busy week. Should be able to merge by tomorrow morning & in maven by afternoon. |
In the meantime, as a sanity check, could you update the benchmark results. I'm not expecting anything egregious but just want to make sure it works. |
no problem and done! I thought I had it up to date, but if not it is now :) |
Issue #, if available:
#70
Description of changes:
Add a case-insensitive anything-but construct:
Benchmark / Performance (for source code changes):
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.