-
Notifications
You must be signed in to change notification settings - Fork 28
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
Validation of behavior and implementation modules #52
Conversation
@msz Hi! How can I trigger CI? |
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.
Great work, thank you! Just a small comment.
lib/hammox.ex
Outdated
Utils.replace_user_types(typespec, behaviour_module_name) | ||
end) | ||
|
||
:error -> |
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.
What is the reason behind handling :error
here? I don't see a use case for this function to silently proceed when the Code.Typespec.fetch_callbacks(behaviour_module_name)
call errors — I'd rather make it fail to be stricter.
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.
Actually, looks like the Code.Typespec.fetch_callbacks(behaviour_module_name)
calls error only then the module doesn't exist. So I think there is a need to add validation of behavior module inside protect/2
function and raise an exception.
Don't worry about CI, it doesn't run on PRs from forks for security |
8738ef5
to
e9fd1ce
Compare
I merged #51, could you rebase and resolve the conflict? |
e9fd1ce
to
f498f98
Compare
Done! :) |
@msz could you add |
👋
relates to #22