From f535137a0ee623a79058dfb8af40270440820a72 Mon Sep 17 00:00:00 2001 From: Mathias Polligkeit Date: Mon, 17 Jul 2023 14:10:59 +0900 Subject: [PATCH 1/2] run dialyzer in test environment --- .dialyzer_ignore.exs | 12 +----------- mix.exs | 11 ++++++----- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/.dialyzer_ignore.exs b/.dialyzer_ignore.exs index 70f6751..fe51488 100644 --- a/.dialyzer_ignore.exs +++ b/.dialyzer_ignore.exs @@ -1,11 +1 @@ -[ - ~r/lib\/flop\/schema\.ex.*no_return Function default_limit\/1 has no local return\./, - ~r/lib\/flop\/schema\.ex.*no_return Function default_order\/1 has no local return\./, - ~r/lib\/flop\/schema\.ex.*no_return Function field_info\/2 has no local return\./, - ~r/lib\/flop\/schema\.ex.*no_return Function field_type\/2 has no local return\./, - ~r/lib\/flop\/schema\.ex.*no_return Function filterable\/1 has no local return\./, - ~r/lib\/flop\/schema\.ex.*no_return Function max_limit\/1 has no local return\./, - ~r/lib\/flop\/schema\.ex.*no_return Function pagination_types\/1 has no local return\./, - ~r/lib\/flop\/schema\.ex.*no_return Function default_pagination_type\/1 has no local return\./, - ~r/lib\/flop\/schema\.ex.*no_return Function sortable\/1 has no local return\./ -] +[] diff --git a/mix.exs b/mix.exs index f9b3302..565bb6f 100644 --- a/mix.exs +++ b/mix.exs @@ -14,16 +14,17 @@ defmodule Flop.MixProject do deps: deps(), test_coverage: [tool: ExCoveralls], preferred_cli_env: [ - coveralls: :test, "coveralls.detail": :test, - "coveralls.post": :test, - "coveralls.html": :test, "coveralls.github": :test, + "coveralls.html": :test, "coveralls.json": :test, + "coveralls.post": :test, "ecto.create": :test, "ecto.drop": :test, "ecto.migrate": :test, - "ecto.reset": :test + "ecto.reset": :test, + coveralls: :test, + dialyzer: :test ], dialyzer: [ ignore_warnings: ".dialyzer_ignore.exs", @@ -55,7 +56,7 @@ defmodule Flop.MixProject do defp deps do [ {:credo, "~> 1.7.0", only: [:dev, :test], runtime: false}, - {:dialyxir, "~> 1.3.0", only: [:dev], runtime: false}, + {:dialyxir, "~> 1.3.0", only: [:dev, :test], runtime: false}, {:ecto, "~> 3.9"}, {:ecto_sql, "~> 3.9", only: :test}, {:ex_doc, "~> 0.21", only: :dev, runtime: false}, From 405e1272531271eabbf3e5aca8af5cf200bbfbbd Mon Sep 17 00:00:00 2001 From: Mathias Polligkeit Date: Mon, 17 Jul 2023 14:11:10 +0900 Subject: [PATCH 2/2] fix type specification --- lib/flop/adapter.ex | 2 +- lib/flop/schema.ex | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/flop/adapter.ex b/lib/flop/adapter.ex index 1b45af6..cc2e2e5 100644 --- a/lib/flop/adapter.ex +++ b/lib/flop/adapter.ex @@ -67,5 +67,5 @@ defmodule Flop.Adapter do This callback will be removed as soon as a better solution is found or made possible. """ - @callback custom_func_builder(opts) :: any when opts: keyword + @callback custom_func_builder(opts) :: Macro.t() when opts: keyword end diff --git a/lib/flop/schema.ex b/lib/flop/schema.ex index 89f1f47..117d569 100644 --- a/lib/flop/schema.ex +++ b/lib/flop/schema.ex @@ -846,7 +846,7 @@ defprotocol Flop.Schema do def max_limit(data) @doc false - @spec custom(any, any) :: Macro.t() + @spec custom(any, any) :: any def custom(data, arg) end