-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Mix Formatter not compiling plugins #11915
Comments
We can do option 2 if a plugin is missing but I am not quite sure if we should do option 1 because for some workflows (like editors) formatting something with a warning may be better than not formatting anything at all? But hopefully 2 will address 1? |
My thoughts on the editor workflows is that personally, I would rather see an error in the editor that formatting failed due to a plugin not being found and be able to fix the issue than to have it silently not run some of the formatting I was expecting and not know why it wasn't formatting correctly. Maybe if we can't find the plugin, we could run the formatter with what we do have, but still raise an error, that way we get the benefits of both? |
Had problems with (2) in the past, +1 for ensuring plugin is compiled when formatting |
I'd be inclined to also do 1), i.e. and raise an error and refuse to run, especially until 2) is resolved. |
To anyone reading this and looking for a quick fix. Make sure that If you are using a ci, here is an example that uses https://github.com/erlef/setup-beam:
|
Elixir and Erlang/OTP versions
Operating system
Github Actions CI
Current behavior
We recently had an issue where we had configured the
HTMLFormatter
as aplugin
in.formatter.exs
and it was failing silently in CI.There are two underlying issues here:
When a plugin defined in
.formatter.exs
is not found,mix format
outputsSkipping formatter plugin Phoenix.LiveView.HTMLFormatter because module cannot be found
but does not return an error code. This is a problem in CI where the output isn't generally reviewed, only error returns.mix format
does not compile the application being formatted or its dependencies. This was ok before plugins, but when a plugin is involved, especially if that plugin is not yet compiled, this is a problem.The combination of these two potentially leaves users in the state of having a Github Actions CI job that performs a checkout and then a
mix format
, which runs without compiling, and then "silently" failed to use the desired plugin.Expected behavior
mix format
should fail if a plugin is not foundmix format
should compile the app when a plugin is defined in.formatter.exs
(maybe only when it is not found?)The text was updated successfully, but these errors were encountered: