WIP: Add complex tag filtering#462
Conversation
Signed-off-by: Lim Ding Wen <limdingwen@gmail.com>
Signed-off-by: Lim Ding Wen <limdingwen@gmail.com>
Feature flag added under |
lauft
left a comment
There was a problem hiding this comment.
Nice POC! 👍🏻 See also the comments in the code.
| auto filtering = IntervalFilterAndGroup ({ | ||
| new IntervalFilterAllInRange ({ filter.start, filter.end }), | ||
| new IntervalFilterAllWithTags (filter.tags()) | ||
| new IntervalFilterAllWithTags (filter.tags(), rules.getBoolean("complexFiltering")) |
There was a problem hiding this comment.
I would not make this a top-level configuration (like e.g. verbose), but put it into a commands subgroup. I propose commands.filtering with values simple (= default) and complex (or maybe better: boolean).
| for (auto& tag : _tags) | ||
| { | ||
| if (! interval.hasTag (tag)) | ||
| if (_complexFiltering) { |
There was a problem hiding this comment.
As you have already said, this should not be part of IntervalFilterAllWithTags, but rather some function or factory which translates the individual command line arguments into filters or filter groups, like e.g. IntervalFilterOrGroup, IntervalFilterWithoutTagSet, etc.
| for (auto& tag : _tags) | ||
| { | ||
| return false; | ||
| if (tag == "OR") |
There was a problem hiding this comment.
Currently, I would opt for lowercase, i.e. or
|
Thanks for the update, @limdingwen !
This is not just a simple replacement of Therefore as a first step, I would split Depending on the respective command (see table in this comment) we can then compose the appropriate filtering. For the new filtering another Later all this could be combined into some kind of |
|
@lauft, @limdingwen : I might have missed it, but I was wondering if the refactor/filtering branch is going to be submitted via a separate PR? |
|
@sruffell I am currently doing some performance tests to check whether something deterioated with |
|
Hey, just an update -- currently doing finals and some other personal projects, would come back to this when I have the time 😄 |
|
@limdingwen FYI: I have merged the refactoring of interval filtering to Good luck for your finals! 🤞🏻 |
Continuation of #456. This WIP PR aims to add complex tag filtering, allowing for boolean operators to be done on tags. Example:
TODO:
Would close #209.
Would close #64.
Would close #358.