khepri_evf: Add event_filter_or_compat() type#346
Merged
Conversation
[Why] This ensures that all public types are correctly exported.
[Why] `string()` is already included in `khepri_path:pattern()`. Also, `khepri_path:pattern()` includes `binary()` which was missing to be consistent.
[Why]
Before, `khepri_evf:wrap/{1,2}` and all users of
`khepri_evf:event_filter()` were specifying the compatible types as
well, i.e. a Khepri path pattern, a string, and so on.
This list of compatible types was inconsistent and sometimes incomplete.
[How]
With the new event filter types coming in a future version of Khepri,
let's add an `event_filter_or_compat()` type which encapsulates the
`event_filter()` type and all compatible types that can be
wrapped into/converted to an event filter automatically.
While here, improve a new macros to correcly check a Khepri path or path
pattern in a guard expression.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v0.17.x #346 +/- ##
===========================================
+ Coverage 86.08% 86.37% +0.28%
===========================================
Files 22 22
Lines 3450 3450
===========================================
+ Hits 2970 2980 +10
+ Misses 480 470 -10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Before,
khepri_evf:wrap/{1,2}and all users ofkhepri_evf:event_filter()were specifying the compatible types as well, i.e. a Khepri path pattern, a string, and so on.This list of compatible types was inconsistent and sometimes incomplete.
How
With the new event filter types coming in a future version of Khepri, let's add an
event_filter_or_compat()type which encapsulates theevent_filter()type and all compatible types that can be wrapped into/converted to an event filter automatically.While here, improve a new macros to correcly check a Khepri path or path pattern in a guard expression.