dashbitco / nimble_options

A tiny library for validating and documenting high-level options. 💽
Apache License 2.0
507 stars 38 forks source link

`{:existing_module, module_name, exports}` type #104

Closed am-kantox closed 1 year ago

am-kantox commented 1 year ago

According to the comment by José, I implemented the ability to check exports as well.

Addresses #103.

whatyouhide commented 1 year ago

I'm starting to have doubts too here. In general, this is kind of mimicking the "behaviour" functionality, where what you might want to be checking is that the given module implements a given behaviour. The fact that the module must be loaded seems more like application logic than option validation?

am-kantox commented 1 year ago

Accepting a behaviour as a third parameter is not an issue, also we have BehaviourModule.behaviour_info(:callbacks) out of the box.

The check for the module availability in compile time might be a duty of options validation in some cases (static consistency check,) or not, and in the latter case we still would have bare :atom type.

I am fine doing it through a custom checker, though.

whatyouhide commented 1 year ago

Closed as per my comment in #103. Thanks so much anyways @am-kantox! 💟