derekkraan / horde

Horde is a distributed Supervisor and Registry backed by DeltaCrdt
MIT License
1.32k stars 106 forks source link

Wrong typespec for Horde.Cluster.members/1 #150

Closed idabmat closed 5 years ago

idabmat commented 5 years ago

Hi @derekkraan.

First of all, thank you for this library!

I use dialyzer in my projects and it complained about a typespec from here: From the supervisor implementation, the return value is

{:ok, Map.keys(...)}

Whereas the typespec for Horde.Cluster.members/1 says the return type should be [members()]

I would have submitted a PR for this small fix, but I was unsure which one should change (the typespec or the return value).

On a side note, would you be interested in adding dialyzer to this project?

Cheers.

derekkraan commented 5 years ago

Hi, thanks for the bug report! Looking at the code, I think it makes sense if we change the code to match the spec, since we are only ever returning {:ok, [member()]} and never something like {:error, _}. I would accept a PR for this.

To answer your other question, I would also accept a PR adding dialyzer to the project. If you want to take a crack at this, make sure you include it in the CI script so that we are actually enforcing it.

Thanks! Derek