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

Add dialyzer #48

Merged
merged 2 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ erl_crash.dump
# Directories that get created during tests
/test/projects/**/_build
/test/projects/**/deps

# Dialyzer files
/priv/plts/*.plt
/priv/plts/*.plt.hash
2 changes: 1 addition & 1 deletion lib/uniform.ex
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ defmodule Uniform do
disk the ejected app will be written, etc.). If there is a mistake, the user will
have a chance to abort before performing a potentially destructive action.
""" && false
@spec prepare(init :: %{name: atom, opts: [prepare_opt]}) :: Uniform.App.t()
@spec prepare(init :: %{name: String.t(), opts: [prepare_opt]}) :: Uniform.App.t()
def prepare(%{name: name, opts: opts}) do
# ensure the name was passed in under_score format; otherwise subtle bugs happen
unless name in Uniform.ejectable_app_names() do
Expand Down
2 changes: 1 addition & 1 deletion lib/uniform/app.ex
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ defmodule Uniform.App do

# Given a manifest struct, returns a `%Deps{}` struct containing
# information about lib and mix dependencies.
@spec deps(Config.t(), Manifest.t()) :: t
@spec deps(Config.t(), Manifest.t()) :: Deps.t()
defp deps(config, manifest) do
all_libs = Config.lib_deps(config)
all_mixs = Config.mix_deps(config)
Expand Down
2 changes: 1 addition & 1 deletion lib/uniform/file.ex
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ defmodule Uniform.File do
# Given a directory, return which paths to eject based on the rules
# associated with that directory. Includes files in `lib/<lib_dir>`
# as well as `test/<lib_dir>`
@spec lib_dir_files(App.t(), String.t(), keyword) :: [Uniform.File.t()]
@spec lib_dir_files(App.t(), String.t(), keyword | map) :: [Uniform.File.t()]
defp lib_dir_files(app, lib_dir, opts) do
# location of lib and test cp_r is configurable for testing
only = opts[:only]
Expand Down
8 changes: 7 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ defmodule Uniform.MixProject do
start_permanent: Mix.env() == :prod,
deps: deps(),
elixirc_paths: elixirc_paths(Mix.env()),
dialyzer: [
plt_add_apps: [:mix],
plt_file: {:no_warn, "priv/plts/dialyzer.plt"},
list_unused_filters: true
],

# Hex
description: "Write less boilerplate and reuse more code in your portfolio of Elixir apps",
Expand All @@ -30,7 +35,8 @@ defmodule Uniform.MixProject do
defp deps do
[
{:ex_doc, ">= 0.30.9", only: [:dev, :docs], runtime: false},
{:sourceror, "~> 0.14"}
{:sourceror, "~> 0.14"},
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false, optional: true}
]
end

Expand Down
2 changes: 2 additions & 0 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
%{
"dialyxir": {:hex, :dialyxir, "1.4.2", "764a6e8e7a354f0ba95d58418178d486065ead1f69ad89782817c296d0d746a5", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "516603d8067b2fd585319e4b13d3674ad4f314a5902ba8130cd97dc902ce6bbd"},
"earmark_parser": {:hex, :earmark_parser, "1.4.37", "2ad73550e27c8946648b06905a57e4d454e4d7229c2dafa72a0348c99d8be5f7", [:mix], [], "hexpm", "6b19783f2802f039806f375610faa22da130b8edc21209d0bff47918bb48360e"},
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
"ex_doc": {:hex, :ex_doc, "0.30.9", "d691453495c47434c0f2052b08dd91cc32bc4e1a218f86884563448ee2502dd2", [:mix], [{:earmark_parser, "~> 1.4.31", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "d7aaaf21e95dc5cddabf89063327e96867d00013963eadf2c6ad135506a8bc10"},
"makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"},
"makeup_elixir": {:hex, :makeup_elixir, "0.16.1", "cc9e3ca312f1cfeccc572b37a09980287e243648108384b97ff2b76e505c3555", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "e127a341ad1b209bd80f7bd1620a15693a9908ed780c3b763bccf7d200c767c6"},
Expand Down
Loading