Current section
Files
Jump to
Current section
Files
lib/mix/tasks/project/gen/quokka_format.ex
defmodule Mix.Tasks.Project.Gen.QuokkaFormat do
@shortdoc "Adds Quokka to formatter plugins"
@moduledoc "Adds `Quokka` to the formatter's `plugins` after the dependency is fetched."
use Igniter.Mix.Task
@impl Igniter.Mix.Task
def igniter(igniter) do
Igniter.update_elixir_file(igniter, ".formatter.exs", fn zipper ->
Igniter.Code.Keyword.set_keyword_key(zipper, :plugins, [Quokka], fn existing ->
Igniter.Code.List.prepend_new_to_list(existing, Quokka)
end)
end)
end
end