This is more of a fix than a feature.
By adding the filename to --stdin-filename, mix format can detect the type of file. By default --stdin-filename is stdin.exs thus only allowing formatting of Elixir.
This change is needed to allow formatting for mix format plugins. Most notably the heex template files which are used in the Phoenix Framework, which comes with a heex plugin by default. (https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.HTMLFormatter.html)
This is more of a fix than a feature. By adding the filename to
--stdin-filename
,mix format
can detect the type of file. By default--stdin-filename
isstdin.exs
thus only allowing formatting of Elixir. This change is needed to allow formatting formix format
plugins. Most notably theheex
template files which are used in the Phoenix Framework, which comes with aheex
plugin by default. (https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.HTMLFormatter.html)The
mix format
behaviour is documented here: https://hexdocs.pm/mix/main/Mix.Tasks.Format.html#module-task-specific-options