diff --git a/.formatter.exs b/.formatter.exs index af6c7f8..8da9f9c 100644 --- a/.formatter.exs +++ b/.formatter.exs @@ -1,4 +1,3 @@ -# Used by "mix format" [ - inputs: [".formatter.exs", "{config,lib,test}/**/*.{ex,exs}"] + inputs: ["*.exs", "{lib,test}/**/*.{ex,exs}"] ] diff --git a/.gitignore b/.gitignore index e790527..f8f26cf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,24 +1,8 @@ -# The directory Mix will write compiled artifacts to. /_build/ - -# If you run "mix test --cover", coverage assets end up here. /cover/ - -# The directory Mix downloads your dependencies sources to. /deps/ - -# Where third-party dependencies like ExDoc output generated docs. /doc/ - -# Ignore .fetch files in case you like to edit your project deps locally. -/.fetch - -# If the VM crashes, it generates a dump, let's ignore it too. +/priv/plts/ erl_crash.dump - -# Also ignore archive artifacts (built via "mix archive.build"). *.ez - -# Ignore package tarball (built via "mix hex.build"). delta-*.tar - diff --git a/.iex.exs b/.iex.exs deleted file mode 100644 index 6a2e3f0..0000000 --- a/.iex.exs +++ /dev/null @@ -1,5 +0,0 @@ -alias Delta.{ - Op, - Attr, - EmbedHandler -} diff --git a/lib/delta/embed_handler.ex b/lib/delta/embed_handler.ex index af8099b..faa8686 100644 --- a/lib/delta/embed_handler.ex +++ b/lib/delta/embed_handler.ex @@ -51,8 +51,7 @@ defmodule Delta.EmbedHandler do %{"retain" => %{"image" => "https://quilljs.com/assets/images/icon.png"}} ] """ - @type t :: module() - @type embed :: map() + @type embed :: map() | list(map()) @callback name() :: binary() @callback compose(any(), any(), keep_nil? :: boolean()) :: embed() diff --git a/mix.exs b/mix.exs index 7fe410e..ab69d01 100644 --- a/mix.exs +++ b/mix.exs @@ -8,6 +8,7 @@ defmodule Delta.MixProject do def project do [ + name: @name, app: @app, version: @version, elixir: "~> 1.18", @@ -15,13 +16,17 @@ defmodule Delta.MixProject do package: package(), deps: deps(), elixirc_paths: elixirc_paths(Mix.env()), - name: @name, docs: [ main: @name, source_url: @github, homepage_url: @github, canonical: "https://hexdocs.pm/#{@app}", extras: ["README.md", "CHANGELOG.md"] + ], + dialyzer: [ + plt_file: {:no_warn, "priv/plts/project.plt"}, + plt_add_apps: [:ex_unit], + list_unused_filters: true ] ] end @@ -39,7 +44,8 @@ defmodule Delta.MixProject do defp deps do [ - {:diff_match_patch, "~> 0.2"}, + {:diff_match_patch, "~> 0.3"}, + {:dialyxir, "~> 1.4.5", only: [:dev, :test], runtime: false}, {:diffy, "~> 1.1"}, {:ex_doc, ">= 0.0.0", only: :dev, runtime: false} ] diff --git a/mix.lock b/mix.lock index b92aaa7..9563732 100644 --- a/mix.lock +++ b/mix.lock @@ -1,7 +1,9 @@ %{ + "dialyxir": {:hex, :dialyxir, "1.4.7", "dda948fcee52962e4b6c5b4b16b2d8fa7d50d8645bbae8b8685c3f9ecb7f5f4d", [:mix], [{:erlex, ">= 0.2.8", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "b34527202e6eb8cee198efec110996c25c5898f43a4094df157f8d28f27d9efe"}, "diff_match_patch": {:hex, :diff_match_patch, "0.3.0", "8741299f6e43d701dc160e28738440f53af0969e3cea79d2d8e57f8dcb631d26", [:mix], [], "hexpm", "cf377f0d7dc4d40cd68fc580c26047351f217be729565e944f8cea36b19013b7"}, "diffy": {:hex, :diffy, "1.1.2", "7060e34fd512f210056b7e66e8d315cb90d06b97a6656d92fc299eb91692e36e", [:rebar3], [{:proper, "~> 1.2.0", [hex: :proper, repo: "hexpm", optional: false]}, {:zotonic_stdlib, "1.2.3", [hex: :zotonic_stdlib, repo: "hexpm", optional: false]}], "hexpm", "9a59bbdcafb6b115b5099711f7f114edb00be11658cef08ef26e04f8040c7149"}, "earmark_parser": {:hex, :earmark_parser, "1.4.44", "f20830dd6b5c77afe2b063777ddbbff09f9759396500cdbe7523efd58d7a339c", [:mix], [], "hexpm", "4778ac752b4701a5599215f7030989c989ffdc4f6df457c5f36938cc2d2a2750"}, + "erlex": {:hex, :erlex, "0.2.8", "cd8116f20f3c0afe376d1e8d1f0ae2452337729f68be016ea544a72f767d9c12", [:mix], [], "hexpm", "9d66ff9fedf69e49dc3fd12831e12a8a37b76f8651dd21cd45fcf5561a8a7590"}, "ex_doc": {:hex, :ex_doc, "0.40.1", "67542e4b6dde74811cfd580e2c0149b78010fd13001fda7cfeb2b2c2ffb1344d", [:mix], [{:earmark_parser, "~> 1.4.44", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "bcef0e2d360d93ac19f01a85d58f91752d930c0a30e2681145feea6bd3516e00"}, "makeup": {:hex, :makeup, "1.2.1", "e90ac1c65589ef354378def3ba19d401e739ee7ee06fb47f94c687016e3713d1", [:mix], [{:nimble_parsec, "~> 1.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "d36484867b0bae0fea568d10131197a4c2e47056a6fbe84922bf6ba71c8d17ce"}, "makeup_elixir": {:hex, :makeup_elixir, "1.0.1", "e928a4f984e795e41e3abd27bfc09f51db16ab8ba1aebdba2b3a575437efafc2", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "7284900d412a3e5cfd97fdaed4f5ed389b8f2b4cb49efc0eb3bd10e2febf9507"}, diff --git a/test/support/case.ex b/test/support/case.ex index fabf740..aec676b 100644 --- a/test/support/case.ex +++ b/test/support/case.ex @@ -4,7 +4,6 @@ defmodule Delta.Support.Case do using do quote do - alias Delta alias Delta.Attr alias Delta.Op alias Delta.Support.MapEmbed