Skip to content
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

Add HTMLFormatter to umbrella root #4800

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion installer/templates/phx_umbrella/formatter.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[
[<%= if @html and Version.match?(System.version(), ">= 1.13.4") do %>
plugins: [Phoenix.LiveView.HTMLFormatter],<% end %>
inputs: ["mix.exs", "config/*.exs"],
subdirectories: ["apps/*"]
]
12 changes: 12 additions & 0 deletions installer/test/phx_new_umbrella_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ defmodule Mix.Tasks.Phx.New.UmbrellaTest do
assert_file root_path(@app, "config/runtime.exs"), ~r/ip: {0, 0, 0, 0, 0, 0, 0, 0}/

if Version.match?(System.version(), ">= 1.13.4") do
assert_file root_path(@app, ".formatter.exs"), fn file ->
assert file =~ "plugins: [Phoenix.LiveView.HTMLFormatter]"
assert file =~ "inputs: [\"mix.exs\", \"config/*.exs\"]"
assert file =~ "subdirectories: [\"apps/*\"]"
end

assert_file app_path(@app, ".formatter.exs"), fn file ->
assert file =~ "import_deps: [:ecto]"
assert file =~ "subdirectories: [\"priv/*/migrations\"]"
Expand All @@ -103,6 +109,12 @@ defmodule Mix.Tasks.Phx.New.UmbrellaTest do
refute file =~ "subdirectories:"
end
else
assert_file root_path(@app, ".formatter.exs"), fn file ->
assert file =~ "inputs: [\"mix.exs\", \"config/*.exs\"]"
assert file =~ "subdirectories: [\"apps/*\"]"
refute file =~ "plugins:"
end

assert_file app_path(@app, ".formatter.exs"), fn file ->
assert file =~ "import_deps: [:ecto]"
assert file =~ "subdirectories: [\"priv/*/migrations\"]"
Expand Down