From 37c2a9381a1f7ae42e507820346a1826a47e037c Mon Sep 17 00:00:00 2001 From: Mario Uher Date: Wed, 20 Mar 2024 20:23:24 +0100 Subject: [PATCH] Add DoctestFormatter and format code --- .formatter.exs | 2 +- lib/twiml.ex | 4 +++- mix.exs | 1 + mix.lock | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.formatter.exs b/.formatter.exs index c17e855..2ed92ee 100644 --- a/.formatter.exs +++ b/.formatter.exs @@ -1,4 +1,4 @@ [ inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"], - plugins: [Styler] + plugins: [DoctestFormatter, Styler] ] diff --git a/lib/twiml.ex b/lib/twiml.ex index 4c46fa7..38ca83a 100644 --- a/lib/twiml.ex +++ b/lib/twiml.ex @@ -113,7 +113,9 @@ defmodule TwiML do ## Examples - iex> TwiML.reject() |> TwiML.comment("Blocked because of insufficient funds") |> TwiML.to_xml(format: :none) + iex> TwiML.reject() + ...> |> TwiML.comment("Blocked because of insufficient funds") + ...> |> TwiML.to_xml(format: :none) ~s(Blocked because of insufficient funds) """ diff --git a/mix.exs b/mix.exs index 2ce6069..0814e0e 100644 --- a/mix.exs +++ b/mix.exs @@ -37,6 +37,7 @@ defmodule Twiml.MixProject do defp deps do [ {:xml_builder, "~> 2.2"}, + {:doctest_formatter, "~> 0.2.0", only: [:dev, :test], runtime: false}, {:ex_doc, "~> 0.31", only: :docs}, {:styler, ">= 0.11.1", only: [:dev, :test], runtime: false} ] diff --git a/mix.lock b/mix.lock index 2ebda36..4f766d2 100644 --- a/mix.lock +++ b/mix.lock @@ -1,4 +1,5 @@ %{ + "doctest_formatter": {:hex, :doctest_formatter, "0.2.0", "fe6198e8d81d833269314696b5bb55c0db0e16f609de53cdcafe1758f53ecf6c", [:mix], [], "hexpm", "34fb0da7cbb704d5caf477e77268fcf7ee9c87e13d94a04ea1865afb9e82e3f5"}, "earmark_parser": {:hex, :earmark_parser, "1.4.39", "424642f8335b05bb9eb611aa1564c148a8ee35c9c8a8bba6e129d51a3e3c6769", [:mix], [], "hexpm", "06553a88d1f1846da9ef066b87b57c6f605552cfbe40d20bd8d59cc6bde41944"}, "ex_doc": {:hex, :ex_doc, "0.31.0", "06eb1dfd787445d9cab9a45088405593dd3bb7fe99e097eaa71f37ba80c7a676", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.1", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "5350cafa6b7f77bdd107aa2199fe277acf29d739aba5aee7e865fc680c62a110"}, "makeup": {:hex, :makeup, "1.1.1", "fa0bc768698053b2b3869fa8a62616501ff9d11a562f3ce39580d60860c3a55e", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "5dc62fbdd0de44de194898b6710692490be74baa02d9d108bc29f007783b0b48"},