-
Notifications
You must be signed in to change notification settings - Fork 16
Add support for custom filters in JSON files #22
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
Conversation
|
Nice! My only suggestion is to make $ csgrep -f <(echo '{"msg-filter":[{"checker":"","regexp":"*"}]}')
terminate called after throwing an instance of 'boost::wrapexcept<boost::regex_error>'
what(): The repeat operator "*" cannot start a regular expression. The error occurred while parsing the regular expression: '>>>HERE>>>*'.
zsh: IOT instruction (core dumped) csgrep -f <(echo '{"msg-filter":[{"checker":"","regexp":"*"}]}')
$ echo $?
134... I would expect something like this: $ csgrep -f <(echo '{"msg-filter":[{"checker":"","regexp":"*"}]}')
/proc/self/fd/11:1: error: Failed to compile regex: The repeat operator "*" cannot start a regular expression. The error occurred while parsing the regular expression: '>>>HERE>>>*
$ echo $?
1@praiskup What is your take on this? |
|
This is nice, thank you @lzaoral for working on this! I'd suggest writing some test case for this, and perhaps document the format somewhere so it is easier to use. |
|
@praiskup Thanks for review! Covering this by tests is already planned as it is written above. And yes, the csdiff project has always been pretty bad regarding documentation of the supported data formats. Any improvements in this regard would certainly be appreciated. |
d6595e0 to
f2c8df6
Compare
|
Amazing progress. Thank you for working on this! My only concern is that If you are fine with it, I would merge #23 first and then rebase this pull request on top of it. There are no conflicts (or test breakage) between these pull requests. We could probably extend the |
... instead of a pointer to pt::ptree to be consistent with getValue.
... so that we can catch sync failures more easily.
|
This should work for us, thank you @lzaoral! |
cbe1444 to
5043f22
Compare
5043f22 to
fb32526
Compare
|
I've just changed the documentation to include meaning of the missing |
|
Merging, thanks for the contribution! |
This is just a draft to see if there are no major issues. I'll add tests if everything will look alright.
Format example:
{ "msg-filter" : [ { "checker" : "DIVINE|SYMBIOTIC", "regexp" : "memory" }, { "checker" : "COMPILER_WARNING", "regexp" : "called on unallocated object", "replace" : "called correctly, no UB here" } ] }