Environment
- Elixir version (elixir -v): 1.17.1
- Phoenix version (mix deps): 1.7.18
- Phoenix LiveView version (mix deps): 1.0.1
- Operating system: macOS 15.0
- Browsers you attempted to reproduce this bug on (the more the merrier): n/a
- Does the problem persist after removing "assets/node_modules" and trying again? Yes/no: yes
Actual behavior
Formatter should format all code in a single pass that will then be accepted by mix format --check-formatted
(related to #3544)
Expected behavior
Formatter has to be run twice to get code to a state where it passes the check.
Example
starting code:
def input(%{type: "select"} = assigns) do
~H"""
<select>
<option :if={@prompt} value="" class="dark:!text-white">{@prompt}</option>
<!-- TODO: set color to below options somehow -->
{IdoWeb.SlimSelectForm.options_for_select(@options, @value, "dark:!text-white")}
</select>
"""
end
with mix.format:
def input(%{type: "select"} = assigns) do
~H"""
<select>
<option :if={@prompt} value="" class="dark:!text-white">{@prompt}</option>
<!-- TODO: set color to below options somehow -->
{IdoWeb.SlimSelectForm.options_for_select(@options, @value, "dark:!text-white")}
</select>
"""
end
(and mix format --check-formatted will error:
396 396 | {IdoWeb.SlimSelectForm.options_for_select(@options, @value, "dark:!text-white")}
397 397 |
398 +|
399 +|
398 400 | </select>
399 401 | """
|
If I run mix.format again, it will add those two extra lines that the check-formatted wants, and then everything passes.
If I remove the line with the TODO comment, the formatting works (and the blank lines before the </select> are removed.
Environment
Actual behavior
Formatter should format all code in a single pass that will then be accepted by
mix format --check-formatted(related to #3544)
Expected behavior
Formatter has to be run twice to get code to a state where it passes the check.
Example
starting code:
with
mix.format:(and
mix format --check-formattedwill error:If I run
mix.formatagain, it will add those two extra lines that thecheck-formattedwants, and then everything passes.If I remove the line with the TODO comment, the formatting works (and the blank lines before the
</select>are removed.