-
Notifications
You must be signed in to change notification settings - Fork 10
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
ortac-dune plugin #190
ortac-dune plugin #190
Conversation
Still in draft as the plugin does not load... |
ae8ba40
to
cdd2a7c
Compare
I've put a |
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.
Thank you for that!
A few remarks:
- I think I would find it nicer for
ortac dune qcheck-stm
to expect the same command-line arguments asortac qcheck-stm
plus the necessary addition for the generation of rules; in particular, that would mean expect--include=...
instead of a positional argument. Would it be possible to share the code creating those arguments, maybe? - I’d prefer not to see commented rules in
plugins/dune-rules/src/dune
. - The plugin generates a rule calling
ortac_dune
: I imagine it should beortac dune
?
Thanks for these remarks. |
cdd2a7c
to
ba2990b
Compare
I'm also thinking about making the |
Good point, I was thinking about |
Do you know whether it would be possible to make an interface such as:
with cmdliner? |
I'm guessing it is not. |
757fd83
to
026b294
Compare
784eeb0
to
7a0a1fb
Compare
I've renamed the |
I should get rid of the ugly empty line generated where an optional argument is absent (see line 25 of the cram test). |
This feature will be usefull to test the dune plugin (ocaml-gospel#190) in CI.
This feature will be usefull to test the dune plugin (ocaml-gospel#190) in CI.
This feature will be usefull to test the dune plugin (ocaml-gospel#190) in CI.
f74c85a
to
3d5ff2d
Compare
676dfa8
to
892097a
Compare
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.
The code that generates the dune rules is a pleasure to read, congratulations!
I have 2 main remarks:
- The rule that will run
ortac qcheck-stm
on some.mli
file must depend on that file (this dependency is currently missing in the generated rule). On the other hand, it doesn’t need to depend on the included file, I think: the generated test will only expect the module to be available, doesn’t it? varray_circular_incl.ml
andvarray_incl.ml
are so similar (I resorted todiff
-ing them, to be honest) that I would have used a functor, even if they are so short.
and a couple of small ones attached to their positions.
The mechanism of including a module in the generated code will be common to several plugins.
adac234
to
85a9f0e
Compare
Thanks for the review! I think I've cover all of your remarks but one: the use of a functor.
I'd propose to postpone this feature (easy support of included files for testing functor instantiation) in order to have a clean way of dealing with them. Also, putting the body of the current included file in a functor, abstracting over the opened file does not work out of the box: I still have an error on the type extension that I don't manage to fix for now:
|
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’m sorry I sent you on a wild goose chase :-/
Anyway, it looks good to me now, thanks!
This commit only propose the `qcheck-stm` sub-command as this is the only plugin release at the moment.
Thank you for the fix. CI is happy so I merge it. |
Plugin to generate dune rules for other plugins.