Mix Formatter importing exported `locals_without_parens`

I am curious about :export and :import_deps in the formatter config files.

I am assuming, for example, that if I import deps from phoenix, since they export locals_without_parens, that the formatter in my project shouldn’t add parens to certain macros.

Maybe I’m not using it correctly or understanding what it should do, but I am not noticing any difference in formatter behaviour with or without the import.

Is this not the correct way to import deps?

import_deps: [:ecto, :phoenix, :plug]

or am I misunderstanding the intended behaviour?

Okay, so… some additional experimenting… in my router.ex

using import_deps: [:ecto, :phoenix, :plug]

get/3, post/3, plug/1, plug/2 do not get parens added. However, resources/3 and pipe_through/1 do

resources is phoenix AFAIK, not native plug. And phoenix doesn’t have a formatter file in its most recent release (1.3.4)


Oh! I was looking at the formatter file on master! That explains it…

1 Like