-
-
Notifications
You must be signed in to change notification settings - Fork 142
Upgrading to 0.4
The 0.4 release is intended to address many deep and longstanding problems in dialyxir
and includes significant changes to defaults which may well be "breaking" for some projects until configuration is removed or updated.
The general principal behind the changes is to provide:
- simplest possible operation - less user configuration for expected usage
- defaults appropriate for a new user of dialyzer
- a smooth experience for projects built on popular frameworks such as Phoenix out-of-the-box
- correct, complete results by default
The largest change in dialyxir
from a user's point of view is that it now is biased towards using OTP application dependencies to determine the set of applications to add to the PLT. By default it will add the same applications you see by running mix app.tree
in your project. It also now uses a project-specific PLT by default, which allows it to remove applications that are no longer in use in the current project. If you were using a plt_add_deps flag, you are encouraged to remove that configuration and update your project file to ensure dependency coverage using the defaults.
- Common gotcha's:
- if you have a runtime dependency on Elixir libraries such as
:eex
, you should add it to your applications list in your mix.exs -
dialyxir
previously included some core OTP applications (such as:crypto
and:public_key
) in the PLT. It still does include some in the core file, but if they are not in use in your application they will be removed from your project-specific file. You should always have these in your OTP Applications list anyway so deployment works correctly - but now it is important todialyxir
.
def application do [applications: [:logger, :eex, :public_key]] end
- if you have a runtime dependency on Elixir libraries such as
- Some project may have dev-only runtime dependencies, such as
:phoenix_live_reload
. This needs to be in your PLT or else you will get warnings, but it doesn't belong in your:applications
list. Useplt_add_apps:
to add it to the PLT e.g.
def project do
[ app: :my_app,
version: "0.0.1",
deps: deps,
dialyzer: [plt_add_apps: [:phoenix_live_reload]]
]
end