From 888269bd6c7ae0f06cb8a7dafbfd8bd97b3fc2f0 Mon Sep 17 00:00:00 2001 From: Alexandre de Souza Date: Mon, 12 Sep 2022 19:34:34 -0300 Subject: [PATCH 1/3] Exclude Mint.HTTP module from warnings --- mix.exs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mix.exs b/mix.exs index 6bb5237..4f26dcb 100644 --- a/mix.exs +++ b/mix.exs @@ -14,7 +14,8 @@ defmodule KinoDB.MixProject do start_permanent: Mix.env() == :prod, deps: deps(), docs: docs(), - package: package() + package: package(), + xref: xref() ] end @@ -55,4 +56,10 @@ defmodule KinoDB.MixProject do } ] end + + def xref do + [ + exclude: [Mint.HTTP] + ] + end end From 74068535e11ae99198687818811e1984b2c4c0db Mon Sep 17 00:00:00 2001 From: Alexandre de Souza Date: Mon, 7 Nov 2022 11:36:39 -0300 Subject: [PATCH 2/3] Apply review comments --- lib/kino_db/connection_cell.ex | 3 +++ mix.exs | 9 +-------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/kino_db/connection_cell.ex b/lib/kino_db/connection_cell.ex index d029789..59a8eb9 100644 --- a/lib/kino_db/connection_cell.ex +++ b/lib/kino_db/connection_cell.ex @@ -391,6 +391,9 @@ defmodule KinoDB.ConnectionCell do defp help_box(_ctx), do: nil + @compile {:no_warn_undefined, {Mint.HTTP, :connect, 3}} + @compile {:no_warn_undefined, {Mint.HTTP, :set_mode, 2}} + defp running_on_google_metadata? do with {:ok, conn} <- Mint.HTTP.connect(:http, "metadata.google.internal", 80), {:ok, _} <- Mint.HTTP.set_mode(conn, :passive), diff --git a/mix.exs b/mix.exs index 4f26dcb..6bb5237 100644 --- a/mix.exs +++ b/mix.exs @@ -14,8 +14,7 @@ defmodule KinoDB.MixProject do start_permanent: Mix.env() == :prod, deps: deps(), docs: docs(), - package: package(), - xref: xref() + package: package() ] end @@ -56,10 +55,4 @@ defmodule KinoDB.MixProject do } ] end - - def xref do - [ - exclude: [Mint.HTTP] - ] - end end From c9016412a1a1b12489e1ca45e8281194383cdd6d Mon Sep 17 00:00:00 2001 From: Alexandre de Souza Date: Mon, 7 Nov 2022 11:43:13 -0300 Subject: [PATCH 3/3] Use single line --- lib/kino_db/connection_cell.ex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/kino_db/connection_cell.ex b/lib/kino_db/connection_cell.ex index 59a8eb9..2c1175b 100644 --- a/lib/kino_db/connection_cell.ex +++ b/lib/kino_db/connection_cell.ex @@ -391,8 +391,7 @@ defmodule KinoDB.ConnectionCell do defp help_box(_ctx), do: nil - @compile {:no_warn_undefined, {Mint.HTTP, :connect, 3}} - @compile {:no_warn_undefined, {Mint.HTTP, :set_mode, 2}} + @compile {:no_warn_undefined, {Mint.HTTP, :connect, 3}, {Mint.HTTP, :set_mode, 2}} defp running_on_google_metadata? do with {:ok, conn} <- Mint.HTTP.connect(:http, "metadata.google.internal", 80),