How to split long function specs?
uohzxela opened this issue · comments
Alex Jiao commented
Let's say I have a very long function spec:
@callback handle_call(request :: term, state :: term) :: {:ok, reply, new_state} | {:ok, reply, new_state, :hibernate} | {:remove_handler, reply}
How do we split this?
Andrea Leopardi commented
I do this
@callback handle_call(request :: term, state :: term) ::
{:ok, reply, new_state} |
{:ok, reply, new_state, :hibernate} |
{:remove_handler, reply}
Alex Jiao commented
Thanks @whatyouhide!
Christopher Adams commented
@lexmag Is this style rule for @callback
, as well as @spec
, deserving of mention in the guide? I'm sure it will keep coming up.