asummers / erlex

Convert Erlang style structs and error messages to equivalent Elixir.
Other
34 stars 16 forks source link

Pretty-printing multiple contract heads #3

Closed evnu closed 6 years ago

evnu commented 6 years ago

When multiple contract heads are encountered, the output would be more reasonable if newline separated the contract heads.

Example from pretty_print_test.exs

expected_output =
  "Contract head: (any(), nil) :: nilContract head: (Ecto.Queryable.t(), String.t()) :: String.t()"

I believe this to be more readable if it includes an additional newline:

expected_output =
  "Contract head: (any(), nil) :: nil\nContract head: (Ecto.Queryable.t(), String.t()) :: String.t()"
asummers commented 6 years ago

That sounds totally reasonable.

evnu commented 6 years ago

I can provide a pull request if you'd like to delegate that.

EDIT: I just went ahead with the PR as I had it done almost anyways :)

asummers commented 6 years ago

This has been published to Hex. It will be bumped in Dialyxir when I fix something else in that project, but you should be able to do mix deps.update erlex and have it bump in your mix.lock file without issue, as that only depends on ~> 0.1 for this library. Thanks again!