Denys Klymenko
Denys Klymenko

Reputation: 413

How to set Elixir 1.6 formatter to add 2 new lines between module functions?

Is there ability to configure .formatter.exs so formatter does 2 new lines between functions in module? Example:

@spec start_link(String.t()) :: {:error, String.t()} | {:ok, pid()}
def start_link(url) do
   Agent.start_link(fn -> %Links{url: url, remaining: [url]} end)
end
# 2 lines
# 
@spec has_more_links?(pid()) :: boolean()
def has_more_links?(agent_pid) do
   length(get_remaining_links(agent_pid)) > 0
end

Thank you!

Upvotes: 2

Views: 240

Answers (1)

Dogbert
Dogbert

Reputation: 222040

This isn't supported at the moment. The documentation says:

The formatter respects the input format in some cases. Those are listed below:

  • ...

  • Newlines inside blocks are kept as in the input except for: 1) expressions that take multiple lines will always have an empty line before and after and 2) empty lines are always squeezed together into a single empty line

  • ...

Upvotes: 4

Related Questions