Skip to content

Commit

Permalink
fix: fix spark.formatter plugin not removing all parens
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Oct 9, 2023
1 parent c89d530 commit b0ab1f2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/spark/formatter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,9 @@ defmodule Spark.Formatter do
{func, meta, body} = node when is_atom(func) ->
count = Enum.count(List.wrap(body))

if builders[func] in [count, count - 1] && Enum.count(List.wrap(body)) &&
builders = Keyword.get_values(builders, func)

if Enum.any?(builders, &(&1 in [count, count - 1])) &&
Keyword.keyword?(meta) &&
meta[:closing] do
{func, Keyword.delete(meta, :closing), body}
Expand Down

0 comments on commit b0ab1f2

Please sign in to comment.