Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mix needs to use --stdin-filename to support non-elixir files like `.…
…heex` I was seeing errors formatting `.heex` files from `elixir-mode`: ``` $ apheleia-from-project-root .formatter.exs mix format - mix format failed for stdin ** (SyntaxError) invalid syntax found on stdin.exs:1:1: error: syntax error before: '<' │ 1 │ <html lang="en" class="[scrollbar-gutter:stable]"> │ ^ │ └─ stdin.exs:1:1 (elixir 1.17.2) lib/code.ex:999: Code.format_string!/2 (mix 1.17.2) lib/mix/tasks/format.ex:649: Mix.Tasks.Format.elixir_format/2 (mix 1.17.2) lib/mix/tasks/format.ex:668: Mix.Tasks.Format.format_file/2 (elixir 1.17.2) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2 (elixir 1.17.2) lib/task/supervised.ex:36: Task.Supervised.reply/4 ``` Looking through the help page for `mix format`, I saw: > `--stdin-filename' - path to the file being formatted on stdin. This is useful if you are using plugins to support custom filetypes such as .heex. Without passing this flag, it is assumed that the code being passed via stdin is valid Elixir code. Defaults to "stdin.exs". This makes that change.
- Loading branch information