-
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
Move to a module based configuration #214
Conversation
dd380c5
to
a927718
Compare
a927718
to
4aa0084
Compare
4ef4a96
to
662cdde
Compare
662cdde
to
27ae30d
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.
This is really nice work, well done!
-
Would it make sense to detect whether part of the configuration is useless / unused, to help users figure out that something they think they have configured is not properly interpreted as such?
A related issue (also pointed out somewhere inindex.mld
but worth a more general note): it would be nice for the configuration module to be as OCaml-code as possible, so that OCaml and Merlin could help write sound configurations. I think we are mostly there already, it would maybe mean not breaking that property when detecting what is skipped, making sure that the example configurations are actually valid OCaml code and tell something about them todune
so that they are typechecked. -
ba6dd9d Change command-line interface for a module-base config
reorders entries inReserr
so that there are in a canonical order. That change is most welcome but:- could it be split in a specific commit, it is worth a change on its own,
- could it be generalised, to all types and both to .ml and .mli?
-
Could
init_sut_txt
be set up to the original source code? If it is always generated frominit_sut
, I would rather keep only that in the data structures, as a very simple way to ensure we have no inconsistency and so the comment at line 45 inConfig
could be skipped. -
1b105e5 Collect optional content for the
Gen
module
I could do with some comment to explain what this module is meant to contain -
b3c82da Add tests for inclusion of
ty
extensions
I expected to seety
extensions in the tests (shouldn’t there be aTy
module in the configuration for that?) -
27ae30d Update Changelog
Even when old features get removed, they shouldn’t disappear from the changelog, especially from a past version. Your new changelog entry might say that some past features are removed on the way, if need be.
| _ -> | ||
let str = Fmt.str "%a" Ppxlib_ast.Pprintast.core_type core_type in | ||
error (Sut_type_not_supported str, Location.none) | ||
|
||
let sut_core_type str = | ||
let value_bindings cfg_uc = |
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.
Maybe rename it extract_init_sut
or something similar? (If I read it correctly, the current name is a duplicate of the type signature)
let open Ppxlib in | ||
try Parse.expression (Lexing.from_string str) |> Reserr.ok | ||
with _ -> Reserr.(error (Syntax_error_in_init_sut str, Location.none)) | ||
let type_declarations cfg_uc = |
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.
Maybe rename it extract sut
or something similar?
in | ||
fold_left aux cfg_uc | ||
|
||
let module_binding cfg_uc (mb : Ppxlib.module_binding) = |
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.
Maybe rename it extract gen_module
or something similar?
27ae30d
to
ada2afc
Compare
Thanks for the review: The typos should be fixed. I've splited and reordered commits regarding sorting, removing and adding constructors for reserr errors. Regarding the use of Regarding renaming, you read correctly, I gave functions the name of the node of the OCaml AST they are inspecting, not making any assumption on the information they collect. In a future PR (I know, I'm thinking backward in time here...) the On the importance of testing: I indeed misplaced the |
Yes, some documentation to explain what the functions extract would be fine too.
😅 |
Will need it shortly.
6a0fd19
to
7517797
Compare
This commit also setup how to run the scan of the configuration module, without implementing any logic yet.
Inforce the constraints that the module definition should be a structure.
Some refactoring as the shape of the generated code is very similar to the one for generators
7517797
to
b25504b
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.
I’ve reviewed mostly the range-diff
, it looks good, thank you!
Could I be so bold as to suggest for Reorder warnings… to also reorder pp_kind
, for uniformity?
plugins/qcheck-stm/doc/index.mld
Outdated
|
||
{ul {li custom [QCheck] generators in a [Gen] module} | ||
{li custom [STM] printers in a [Pp] module} | ||
{li custom [STM.ty] extensions and its functional construtors in a [Ty] |
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.
Typo: constructors
23acab5
to
c8d8d78
Compare
Thanks. Waiting for the CI to be green again then merging. |
c8d8d78
to
ae6f8fe
Compare
Just need reformatting. |
ae6f8fe
to
e190f82
Compare
Fixes #173
This PR proposes to move from a command-line based configuration to a module-based configuration.
It does so adopting the proposition of this comment
It is in two folds: the first 17 commits change the way Ortac/QCheck-STM is configured and the next 4 commits update the Ortac/Dune plugin and the examples.
The changes in the Ortac/Dune module also integrate some sort of fix: the
ortac dune qcheck-stm
command now takes the actual filenames (that is with the extensions). I find it to be more natural.