Skip to content
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

Fix dyalizer errors and warns #393

Merged

Conversation

gabrielgiordan
Copy link
Contributor

@gabrielgiordan gabrielgiordan commented Jun 16, 2020

After struggling with a Tesla.Mock.json/2 dialyzer warning at my application, I have found that the opts spec is a keyword list inside a list, instead of a plain keyword list.

So, I have analyzed other warnings and errors and also fixed those.

Checking PLT...
[:castore, :dialyxir, :elixir, :ex_doc, :exjsx, :fuse, :gun, :hackney, :ibrowse, :idna, :inets, :jason, :kernel, :logger, :mime, :mint, :mix_test_watch, :poison, :ssl, :ssl_verify_fun, :stdlib, :telemetry]
PLT is up to date!
No :ignore_warnings opt specified in mix.exs and default does not exist.

Starting Dialyzer
[
  check_plt: false,
  init_plt: '/Users/gabriel.medina/Git/tesla/_build/dev/dialyxir_erlang-22.3.4_elixir-1.10.3_deps-dev.plt',
  files: ['/Users/gabriel.medina/Git/tesla/_build/dev/lib/tesla/ebin/Elixir.Tesla.Middleware.JSON.beam',
   '/Users/gabriel.medina/Git/tesla/_build/dev/lib/tesla/ebin/Elixir.Tesla.Middleware.DecompressResponse.beam',
   '/Users/gabriel.medina/Git/tesla/_build/dev/lib/tesla/ebin/Elixir.Tesla.Middleware.Logger.beam',
   '/Users/gabriel.medina/Git/tesla/_build/dev/lib/tesla/ebin/Elixir.Tesla.Adapter.Gun.beam',
   '/Users/gabriel.medina/Git/tesla/_build/dev/lib/tesla/ebin/Elixir.Tesla.Middleware.Compression.beam',
   ...],
  warnings: [:unknown]
]
Total errors: 0, Skipped: 0, Unnecessary Skips: 0
done in 0m1.7s
done (passed successfully)

Edit: I suppose the CI is expected to fail at certificates_verification for test/tesla/adapter/mint_test.exs:59, as other PRs also failed at this step, is it right?

Since @disable_legacy_event is a compile_env equivalent env
response_opts is already a keyword list
response_opts is already a keyword list
The opts parameter is not a map, but a keyword list
:gun.info from master does return :origin_scheme
To handle gun_opts with keys from master :gun branch
To does not complain on gun_opts with keys from master :gun branch
Fix: Function :idna.encode/1 does not exist.
Fix: Function :ssl_verify_hostname.verify_fun/3 does not exist.
Copy link
Member

@teamon teamon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 Thank you for looking into that! I left a few comments.

cc @alex-strizhakov

lib/tesla/adapter/gun.ex Show resolved Hide resolved
lib/tesla/adapter/mint.ex Outdated Show resolved Hide resolved
Copy link
Contributor

@alex-strizhakov alex-strizhakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@teamon teamon merged commit 1f0f918 into elixir-tesla:master Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants