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
Proof of concept of CB-checker #416
Conversation
|
This is in draft format for the moment, because I can't get the packaging right, but the main code is ready for review @art-w @punchagan ! |
| | None -> () | ||
| | Some l -> | ||
| let merged = Cb_schema.S.merge [] l |> List.map Cb_schema.S.to_json in | ||
| Format.printf "Correctly parsed %d benchmark(s):\n" (List.length merged); |
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.
Nitpick: we may have parsed more valid jsons than what remains after the merge (which could collapse everything down to one result :P )
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.
Do you mean that in some cases, even though a merge would succeed, it would not be desirable? Or that we need to treat the result of the merge as a list?
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.
Nah nothing that complex, my comment was just about the phrasing of "**Correctly parsed** %d benchmarks" (the list validated holds the number of correctly parsed jsons, while the list merged can be much smaller after merging all the jsons together)
(I don't know that we care about either length, so perhaps we can just drop this debug output ^^)
| merged | ||
|
|
||
| let () = | ||
| let ic = if Array.length Sys.argv >= 2 then open_in Sys.argv.(1) else stdin in |
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.
As a later improvement, it might be worth looking into Cmdliner (only for its ability to generate a user friendly --help man page, we don't need crazy command line arguments... for now :D)
30e6cee
to
60f8577
Compare
|
The new commit history should be much clearer, and allow for more precise reviewing. |
5f4d255
to
658b1b6
Compare
This PR creates two new packages:
cb-schemawhich is used internally as the one-stop API, andcb-checkwhich is an executable taking in a file or stdin and checking that the produced json is of the correct format.This would probably solve #385.
PS: I unified the various
.ocamlformatfiles that were lying around for some reason, sorry for the noise