-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclude Mint.HTTP module from warnings #51
base: main
Are you sure you want to change the base?
Conversation
aleDsz
commented
Nov 7, 2022
Wait, do we use |
Yeah, we have one occurrence:
+1 on standardising either way. :) |
@@ -391,6 +391,8 @@ defmodule KinoDB.ConnectionCell do | |||
|
|||
defp help_box(_ctx), do: nil | |||
|
|||
@compile {:no_warn_undefined, {Mint.HTTP, :connect, 3}, {Mint.HTTP, :set_mode, 2}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be two lines like you previously had:
@compile {:no_warn_undefined, {Mint.HTTP, :connect, 3}, {Mint.HTTP, :set_mode, 2}} | |
@compile {:no_warn_undefined, {Mint.HTTP, :connect, 3}} | |
@compile {:no_warn_undefined, {Mint.HTTP, :set_mode, 2}} |
pro-tip, the way I tested it was:
$ elixir -e 'Mix.install [{:kino_db, path: "~/src/kino_db"}], force: true'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or mix compile --force --no-optional-deps
🐱
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, forgot about that one. we should add it to CI if we don't have it already :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, @aleDsz feel free to add as part of this PR :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With mix compile --warnings-as-errors --force --no-optional-deps
it still fails
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this seems like a bug. I noticed with [xref: [exclude: [Mint.HTTP]]
it works correctly but with @compile ...
I'm getting:
~/src/kino_db[main]% mix compile --warnings-as-errors --no-optional-deps --force
Compiling 4 files (.ex)
warning: Mint.HTTP.connect/3 defined in application :mint is used by the current application but the current application does not depend on :mint. To fix this, you must do one of:
1. If :mint is part of Erlang/Elixir, you must include it under :extra_applications inside "def application" in your mix.exs
2. If :mint is a dependency, make sure it is listed under "def deps" in your mix.exs
3. In case you don't want to add a requirement to :mint, you may optionally skip this warning by adding [xref: [exclude: [Mint.HTTP]]] to your "def project" in mix.exs
lib/kino_db/connection_cell.ex:398: KinoDB.ConnectionCell.running_on_google_metadata?/0
warning: Mint.HTTP.set_mode/2 defined in application :mint is used by the current application but the current application does not depend on :mint. To fix this, you must do one of:
1. If :mint is part of Erlang/Elixir, you must include it under :extra_applications inside "def application" in your mix.exs
2. If :mint is a dependency, make sure it is listed under "def deps" in your mix.exs
3. In case you don't want to add a requirement to :mint, you may optionally skip this warning by adding [xref: [exclude: [Mint.HTTP]]] to your "def project" in mix.exs
lib/kino_db/connection_cell.ex:399: KinoDB.ConnectionCell.running_on_google_metadata?/0
Compilation failed due to warnings while using the --warnings-as-errors option
For anyone else testing this locally, first do rm -rf _build
. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's odd, because DBConnection
doesn't fail