Fix mix-format for .heex files#304
Conversation
Per the documentation for `mix format`:
```
• --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".
```
|
It seems the test is failing because the test suite is using elixir 1.12 (because of ubuntu 22) and this option was added in 1.14 (available on ubuntu 23+) |
raxod502
left a comment
There was a problem hiding this comment.
✨ Ok, LGTM, I am a bit worried that Ubuntu 23+ is a pretty high minimum version requirement, but it is easy to customize the command back to the old version if necessary, and if a lot of people run into difficulty out of the box then we could add a wrapper script to intelligently pick the correct command-line based on the version.
|
Oh I see, as you said this blocks CI. Hmmm, can we implement the wrapper script now then, so that it works for CI but also for everyone who is not running the latest package version? |
|
I can give it a shot, is there an example in this repo of a similar behavior? |
|
There aren't any other formatters that have conditioning on the version in use currently, but there are other wrapper scripts in the If you just want to keep things simply for now, I am okay with that too, like I mentioned we can change it later if we receive complaints. Looks like the formatting sample data needs to be updated though to reflect the new tool version: |
|
So I tried adding a new test for |

Per the documentation for
mix format: