-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix mix-format for .heex
files
#304
base: main
Are you sure you want to change the base?
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+) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✨ 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
: