Skip to content
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

[R21] Fix complilation, specs, add specs to generated repo code #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maximvl
Copy link

@maximvl maximvl commented Jul 3, 2019

A new clean PR to replace #10

@@ -259,7 +259,10 @@ repo_sup_spec(Repo) ->
repo_fun_template(Mod, Fun, Arity, Repo, Adapter) ->
Args = splicing_args(Arity),
Body = build_repo_fun(Repo, Adapter, Mod, atom_to_list(Fun), Args),
{Fun, Arity, Body}.
case build_repo_fun_spec(Repo, Fun, Args) of
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thing is, when you have behaviour and the callbacks are well defined in terms of specs, it shouldn't be necessary to duplicate the same spec every time you implement that behaviour, that's why you can use the @hidden tag. I think it is something that has to be improved for dialyzer, but in the meantime, I will disable mandatory specs for all exported functions.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get your point, somehow having specs on callback is not enough. How would you disable mandatory specs?

@cabol
Copy link
Owner

cabol commented Jul 3, 2019

@maximvl I think, for the implemented callbacks it shouldn't be necessary to add specs (the spec is already defined in the callback), since the spec will be the same and you will end up duplicating the same spec every time you implement a behavior. If dialyzer complains is maybe because you are forcing specs for all exported functions.

@maximvl
Copy link
Author

maximvl commented Jul 3, 2019

@cabol I'm using current project configuration and check with rebar3 ct via xdb_meta_SUITE. Not sure what is forcing specs for all functions

@cabol
Copy link
Owner

cabol commented Aug 20, 2019

@maximvl in the meta suite:

init_per_suite(Config) ->
  Dialyzer = {dialyzer_warnings, [
    no_return,
    unmatched_returns,
    error_handling,
    unknown
  ]},

  [{application, cross_db}, Dialyzer | Config].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants