From b610d1a87885576e0e2aa4cfb5e176072bcd9457 Mon Sep 17 00:00:00 2001 From: Lukasz Samson Date: Sun, 30 Oct 2022 09:32:17 +0100 Subject: [PATCH] vendor Dialyxir This prevents module conflicts with the user's version of Dialyxir (and Dialyzex) since both are loaded into the same beam instance --- .tool-versions | 2 - lib/dialyxir.ex | 4 +- lib/dialyxir/dialyzer.ex | 26 ++--- lib/dialyxir/filter_map.ex | 2 +- lib/dialyxir/formatter.ex | 12 +-- lib/dialyxir/formatter/dialyxir.ex | 10 +- lib/dialyxir/formatter/dialyzer.ex | 6 +- lib/dialyxir/formatter/github.ex | 8 +- lib/dialyxir/formatter/ignore_file.ex | 6 +- lib/dialyxir/formatter/raw.ex | 6 +- lib/dialyxir/formatter/short.ex | 8 +- lib/dialyxir/output.ex | 2 +- lib/dialyxir/plt.ex | 6 +- lib/dialyxir/project.ex | 12 +-- lib/dialyxir/warning.ex | 2 +- lib/dialyxir/warning_helpers.ex | 2 +- lib/dialyxir/warnings.ex | 94 +++++++++---------- lib/dialyxir/warnings/app_call.ex | 14 +-- lib/dialyxir/warnings/apply.ex | 14 +-- lib/dialyxir/warnings/binary_construction.ex | 14 +-- lib/dialyxir/warnings/call.ex | 14 +-- .../warnings/call_to_missing_function.ex | 12 +-- lib/dialyxir/warnings/call_with_opaque.ex | 18 ++-- lib/dialyxir/warnings/call_without_opaque.ex | 16 ++-- .../callback_argument_type_mismatch.ex | 14 +-- .../warnings/callback_info_missing.ex | 12 +-- lib/dialyxir/warnings/callback_missing.ex | 12 +-- .../warnings/callback_not_exported.ex | 12 +-- .../callback_spec_argument_type_mismatch.ex | 14 +-- .../warnings/callback_spec_type_mismatch.ex | 12 +-- .../warnings/callback_type_mismatch.ex | 12 +-- lib/dialyxir/warnings/contract_diff.ex | 14 +-- lib/dialyxir/warnings/contract_range.ex | 14 +-- lib/dialyxir/warnings/contract_subtype.ex | 12 +-- lib/dialyxir/warnings/contract_supertype.ex | 12 +-- lib/dialyxir/warnings/contract_with_opaque.ex | 12 +-- lib/dialyxir/warnings/exact_equality.ex | 12 +-- lib/dialyxir/warnings/extra_range.ex | 12 +-- .../function_application_arguments.ex | 18 ++-- .../function_application_no_function.ex | 12 +-- lib/dialyxir/warnings/guard_fail.ex | 12 +-- lib/dialyxir/warnings/guard_fail_pattern.ex | 12 +-- .../warnings/improper_list_construction.ex | 14 +-- lib/dialyxir/warnings/invalid_contract.ex | 12 +-- lib/dialyxir/warnings/map_update.ex | 12 +-- lib/dialyxir/warnings/missing_range.ex | 12 +-- lib/dialyxir/warnings/negative_guard_fail.ex | 12 +-- lib/dialyxir/warnings/no_return.ex | 12 +-- lib/dialyxir/warnings/opaque_equality.ex | 14 +-- lib/dialyxir/warnings/opaque_guard.ex | 14 +-- lib/dialyxir/warnings/opaque_match.ex | 12 +-- lib/dialyxir/warnings/opaque_nonequality.ex | 14 +-- lib/dialyxir/warnings/opaque_type_test.ex | 14 +-- lib/dialyxir/warnings/overlapping_contract.ex | 12 +-- lib/dialyxir/warnings/pattern_match.ex | 12 +-- .../warnings/pattern_match_covered.ex | 12 +-- lib/dialyxir/warnings/record_construction.ex | 14 +-- lib/dialyxir/warnings/record_matching.ex | 14 +-- lib/dialyxir/warnings/unknown_behaviour.ex | 14 +-- lib/dialyxir/warnings/unknown_function.ex | 14 +-- lib/dialyxir/warnings/unknown_type.ex | 12 +-- lib/dialyxir/warnings/unmatched_return.ex | 12 +-- lib/dialyxir/warnings/unused_function.ex | 12 +-- lib/mix/tasks/dialyzer.ex | 22 ++--- lib/mix/tasks/dialyzer/explain.ex | 8 +- mix.exs | 8 +- test/dialyxir/dialyzer_test.exs | 4 +- test/dialyxir/formatter_test.exs | 14 +-- test/dialyxir/output_test.exs | 4 +- test/dialyxir/plt_test.exs | 6 +- test/dialyxir/project_test.exs | 4 +- test/examples/apply.ex | 2 +- test/examples/call.ex | 2 +- test/examples/callback_argument.ex | 2 +- test/examples/callback_spec_argument.ex | 2 +- test/examples/contract_supertype.ex | 2 +- test/examples/contract_with_opaque.ex | 2 +- test/examples/exact_equality.ex | 2 +- test/examples/extra-range.ex | 2 +- test/examples/function_app_args.ex | 2 +- test/examples/function_app_no_fun.ex | 2 +- test/examples/guard_fail.ex | 2 +- test/examples/guard_fail_pattern.ex | 2 +- test/examples/opaque_equality.ex | 2 +- test/examples/opaque_match.ex | 2 +- test/examples/pattern_match.ex | 2 +- test/examples/pattern_match_covered.ex | 2 +- test/examples/unknown_type.ex | 2 +- test/mix/tasks/dialyzer_test.exs | 8 +- test/warning_test.exs | 4 +- 90 files changed, 462 insertions(+), 464 deletions(-) delete mode 100644 .tool-versions diff --git a/.tool-versions b/.tool-versions deleted file mode 100644 index a3c95f7b..00000000 --- a/.tool-versions +++ /dev/null @@ -1,2 +0,0 @@ -elixir 1.12.2 -erlang 24.0.5 diff --git a/lib/dialyxir.ex b/lib/dialyxir.ex index 4b2a1fdb..897c411a 100644 --- a/lib/dialyxir.ex +++ b/lib/dialyxir.ex @@ -1,7 +1,7 @@ -defmodule Dialyxir do +defmodule DialyxirVendored do @moduledoc false use Application - alias Dialyxir.Output + alias DialyxirVendored.Output def start(_, _) do Output.info(""" diff --git a/lib/dialyxir/dialyzer.ex b/lib/dialyxir/dialyzer.ex index c3374e58..40fe4e9f 100644 --- a/lib/dialyxir/dialyzer.ex +++ b/lib/dialyxir/dialyzer.ex @@ -1,9 +1,9 @@ -defmodule Dialyxir.Dialyzer do - import Dialyxir.Output, only: [color: 2, info: 1] +defmodule DialyxirVendored.Dialyzer do + import DialyxirVendored.Output, only: [color: 2, info: 1] alias String.Chars - alias Dialyxir.Formatter - alias Dialyxir.Project - alias Dialyxir.FilterMap + alias DialyxirVendored.Formatter + alias DialyxirVendored.Project + alias DialyxirVendored.FilterMap defmodule Runner do @dialyxir_args [ @@ -20,28 +20,28 @@ defmodule Dialyxir.Dialyzer do formatter = cond do split[:format] == "dialyzer" -> - Dialyxir.Formatter.Dialyzer + DialyxirVendored.Formatter.Dialyzer split[:format] == "dialyxir" -> - Dialyxir.Formatter.Dialyxir + DialyxirVendored.Formatter.DialyxirVendored split[:format] == "github" -> - Dialyxir.Formatter.Github + DialyxirVendored.Formatter.Github split[:format] == "ignore_file" -> - Dialyxir.Formatter.IgnoreFile + DialyxirVendored.Formatter.IgnoreFile split[:format] == "raw" -> - Dialyxir.Formatter.Raw + DialyxirVendored.Formatter.Raw split[:format] == "short" -> - Dialyxir.Formatter.Short + DialyxirVendored.Formatter.Short split[:raw] -> - Dialyxir.Formatter.Raw + DialyxirVendored.Formatter.Raw true -> - Dialyxir.Formatter.Dialyxir + DialyxirVendored.Formatter.DialyxirVendored end info("Starting Dialyzer") diff --git a/lib/dialyxir/filter_map.ex b/lib/dialyxir/filter_map.ex index 6b6035f2..4c53046e 100644 --- a/lib/dialyxir/filter_map.ex +++ b/lib/dialyxir/filter_map.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.FilterMap do +defmodule DialyxirVendored.FilterMap do @moduledoc """ A counters holding warnings to be skipped. diff --git a/lib/dialyxir/formatter.ex b/lib/dialyxir/formatter.ex index ed97eb78..a99cd0f0 100644 --- a/lib/dialyxir/formatter.ex +++ b/lib/dialyxir/formatter.ex @@ -1,13 +1,13 @@ -defmodule Dialyxir.Formatter do +defmodule DialyxirVendored.Formatter do @moduledoc """ Elixir-friendly dialyzer formatter. Wrapper around normal Dialyzer warning messages that provides example output for error messages. """ - import Dialyxir.Output, only: [info: 1] + import DialyxirVendored.Output, only: [info: 1] - alias Dialyxir.FilterMap + alias DialyxirVendored.FilterMap @type warning() :: {tag :: term(), {file :: Path.t(), line :: pos_integer()}, {atom(), list()}} @@ -96,11 +96,11 @@ defmodule Dialyxir.Formatter do end defp filter_warning(filterer, warning = {_, {file, line}, {warning_type, _}}, filter_map) do - if Map.has_key?(Dialyxir.Warnings.warnings(), warning_type) do + if Map.has_key?(DialyxirVendored.Warnings.warnings(), warning_type) do {skip?, matching_filters} = try do filterer.filter_warning?( - {to_string(file), warning_type, line, Dialyxir.Formatter.Short.format(warning)}, + {to_string(file), warning_type, line, DialyxirVendored.Formatter.Short.format(warning)}, filter_map ) rescue @@ -130,7 +130,7 @@ defmodule Dialyxir.Formatter do Enum.reject(warnings, fn warning -> formatted_warnings = warning - |> Dialyxir.Formatter.Dialyzer.format() + |> DialyxirVendored.Formatter.Dialyzer.format() |> List.wrap() Enum.empty?(filterer.filter_legacy_warnings(formatted_warnings)) diff --git a/lib/dialyxir/formatter/dialyxir.ex b/lib/dialyxir/formatter/dialyxir.ex index 84651ad5..d73a7240 100644 --- a/lib/dialyxir/formatter/dialyxir.ex +++ b/lib/dialyxir/formatter/dialyxir.ex @@ -1,9 +1,9 @@ -defmodule Dialyxir.Formatter.Dialyxir do +defmodule DialyxirVendored.Formatter.DialyxirVendored do @moduledoc false - @behaviour Dialyxir.Formatter + @behaviour DialyxirVendored.Formatter - @impl Dialyxir.Formatter + @impl DialyxirVendored.Formatter def format(dialyzer_warning = {_tag, {file, line}, message}) do {warning_name, arguments} = message base_name = Path.relative_to_cwd(file) @@ -76,12 +76,12 @@ defmodule Dialyxir.Formatter.Dialyxir do #{message} Legacy warning: - #{Dialyxir.Formatter.Dialyzer.format(warning)} + #{DialyxirVendored.Formatter.Dialyzer.format(warning)} """ end defp warning(warning_name) do - warnings = Dialyxir.Warnings.warnings() + warnings = DialyxirVendored.Warnings.warnings() if Map.has_key?(warnings, warning_name) do Map.get(warnings, warning_name) diff --git a/lib/dialyxir/formatter/dialyzer.ex b/lib/dialyxir/formatter/dialyzer.ex index 934eabd7..683c6070 100644 --- a/lib/dialyxir/formatter/dialyzer.ex +++ b/lib/dialyxir/formatter/dialyzer.ex @@ -1,9 +1,9 @@ -defmodule Dialyxir.Formatter.Dialyzer do +defmodule DialyxirVendored.Formatter.Dialyzer do @moduledoc false - @behaviour Dialyxir.Formatter + @behaviour DialyxirVendored.Formatter - @impl Dialyxir.Formatter + @impl DialyxirVendored.Formatter def format(warning) do # OTP 22 uses indented output, but that's incompatible with dialyzer.ignore-warnings format. # Can be disabled, but OTP 21 and older only accept an atom, so only disable on OTP 22+. diff --git a/lib/dialyxir/formatter/github.ex b/lib/dialyxir/formatter/github.ex index 999cbcd8..a48cb46a 100644 --- a/lib/dialyxir/formatter/github.ex +++ b/lib/dialyxir/formatter/github.ex @@ -1,9 +1,9 @@ -defmodule Dialyxir.Formatter.Github do +defmodule DialyxirVendored.Formatter.Github do @moduledoc false - @behaviour Dialyxir.Formatter + @behaviour DialyxirVendored.Formatter - @impl Dialyxir.Formatter + @impl DialyxirVendored.Formatter def format({_tag, {file, line}, {warning_name, arguments}}) do base_name = Path.relative_to_cwd(file) @@ -14,7 +14,7 @@ defmodule Dialyxir.Formatter.Github do end defp warning(warning_name) do - warnings = Dialyxir.Warnings.warnings() + warnings = DialyxirVendored.Warnings.warnings() if Map.has_key?(warnings, warning_name) do Map.get(warnings, warning_name) diff --git a/lib/dialyxir/formatter/ignore_file.ex b/lib/dialyxir/formatter/ignore_file.ex index b1bf6cc1..c270948a 100644 --- a/lib/dialyxir/formatter/ignore_file.ex +++ b/lib/dialyxir/formatter/ignore_file.ex @@ -1,9 +1,9 @@ -defmodule Dialyxir.Formatter.IgnoreFile do +defmodule DialyxirVendored.Formatter.IgnoreFile do @moduledoc false - @behaviour Dialyxir.Formatter + @behaviour DialyxirVendored.Formatter - @impl Dialyxir.Formatter + @impl DialyxirVendored.Formatter def format({_tag, {file, _line}, {warning_name, _arguments}}) do ~s({"#{file}", :#{warning_name}},) end diff --git a/lib/dialyxir/formatter/raw.ex b/lib/dialyxir/formatter/raw.ex index c18a221a..e6e5813d 100644 --- a/lib/dialyxir/formatter/raw.ex +++ b/lib/dialyxir/formatter/raw.ex @@ -1,9 +1,9 @@ -defmodule Dialyxir.Formatter.Raw do +defmodule DialyxirVendored.Formatter.Raw do @moduledoc false - @behaviour Dialyxir.Formatter + @behaviour DialyxirVendored.Formatter - @impl Dialyxir.Formatter + @impl DialyxirVendored.Formatter def format(warning) do inspect(warning, limit: :infinity) end diff --git a/lib/dialyxir/formatter/short.ex b/lib/dialyxir/formatter/short.ex index dbb32de5..667ed2eb 100644 --- a/lib/dialyxir/formatter/short.ex +++ b/lib/dialyxir/formatter/short.ex @@ -1,9 +1,9 @@ -defmodule Dialyxir.Formatter.Short do +defmodule DialyxirVendored.Formatter.Short do @moduledoc false - @behaviour Dialyxir.Formatter + @behaviour DialyxirVendored.Formatter - @impl Dialyxir.Formatter + @impl DialyxirVendored.Formatter def format({_tag, {file, line}, {warning_name, arguments}}) do base_name = Path.relative_to_cwd(file) @@ -14,7 +14,7 @@ defmodule Dialyxir.Formatter.Short do end defp warning(warning_name) do - warnings = Dialyxir.Warnings.warnings() + warnings = DialyxirVendored.Warnings.warnings() if Map.has_key?(warnings, warning_name) do Map.get(warnings, warning_name) diff --git a/lib/dialyxir/output.ex b/lib/dialyxir/output.ex index 12de41c3..d8d11795 100644 --- a/lib/dialyxir/output.ex +++ b/lib/dialyxir/output.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Output do +defmodule DialyxirVendored.Output do alias IO.ANSI def color(text, color) when is_binary(text) do diff --git a/lib/dialyxir/plt.ex b/lib/dialyxir/plt.ex index 43dc0c9f..dc2d8796 100644 --- a/lib/dialyxir/plt.ex +++ b/lib/dialyxir/plt.ex @@ -2,11 +2,11 @@ # Copyright by James Fish # https://github.com/fishcakez/dialyze -defmodule Dialyxir.Plt do +defmodule DialyxirVendored.Plt do @moduledoc false - import Dialyxir.Output - alias Dialyxir.Formatter + import DialyxirVendored.Output + alias DialyxirVendored.Formatter def check(plts, fun \\ &check_plt/4) do find_plts(plts, [], fun) diff --git a/lib/dialyxir/project.ex b/lib/dialyxir/project.ex index 0df5b5fd..8ddab12f 100644 --- a/lib/dialyxir/project.ex +++ b/lib/dialyxir/project.ex @@ -1,8 +1,8 @@ -defmodule Dialyxir.Project do +defmodule DialyxirVendored.Project do @moduledoc false - import Dialyxir.Output, only: [info: 1, error: 1] + import DialyxirVendored.Output, only: [info: 1, error: 1] - alias Dialyxir.FilterMap + alias DialyxirVendored.FilterMap def plts_list(deps, include_project \\ true, exclude_core \\ false) do elixir_apps = [:elixir] @@ -33,7 +33,7 @@ defmodule Dialyxir.Project do def check_config do if is_binary(dialyzer_config()[:plt_file]) do info(""" - Notice: :plt_file is deprecated as Dialyxir now uses project-private PLT files by default. + Notice: :plt_file is deprecated as DialyxirVendored now uses project-private PLT files by default. If you want to use this setting without seeing this warning, provide it in a pair with the :no_warn key e.g. `dialyzer: plt_file: {:no_warn, "~/mypltfile"}` """) @@ -295,7 +295,7 @@ defmodule Dialyxir.Project do :project -> info( - "Dialyxir has deprecated plt_add_deps: :project in favor of apps_direct, which includes only runtime dependencies." + "DialyxirVendored has deprecated plt_add_deps: :project in favor of apps_direct, which includes only runtime dependencies." ) deps_project() ++ deps_app(false) @@ -305,7 +305,7 @@ defmodule Dialyxir.Project do :transitive -> info( - "Dialyxir has deprecated plt_add_deps: :transitive in favor of app_tree, which includes only runtime dependencies." + "DialyxirVendored has deprecated plt_add_deps: :transitive in favor of app_tree, which includes only runtime dependencies." ) deps_transitive() ++ deps_app(true) diff --git a/lib/dialyxir/warning.ex b/lib/dialyxir/warning.ex index b3e7a79f..868e9130 100644 --- a/lib/dialyxir/warning.ex +++ b/lib/dialyxir/warning.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warning do +defmodule DialyxirVendored.Warning do @moduledoc """ Behaviour for defining warning semantics. diff --git a/lib/dialyxir/warning_helpers.ex b/lib/dialyxir/warning_helpers.ex index c40f55a6..a5ca538b 100644 --- a/lib/dialyxir/warning_helpers.ex +++ b/lib/dialyxir/warning_helpers.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.WarningHelpers do +defmodule DialyxirVendored.WarningHelpers do @spec ordinal(non_neg_integer) :: String.t() def ordinal(1), do: "1st" def ordinal(2), do: "2nd" diff --git a/lib/dialyxir/warnings.ex b/lib/dialyxir/warnings.ex index 9e1b2216..427cdec3 100644 --- a/lib/dialyxir/warnings.ex +++ b/lib/dialyxir/warnings.ex @@ -1,52 +1,52 @@ -defmodule Dialyxir.Warnings do +defmodule DialyxirVendored.Warnings do @warnings Enum.into( [ - Dialyxir.Warnings.AppCall, - Dialyxir.Warnings.Apply, - Dialyxir.Warnings.BinaryConstruction, - Dialyxir.Warnings.Call, - Dialyxir.Warnings.CallToMissingFunction, - Dialyxir.Warnings.CallWithOpaque, - Dialyxir.Warnings.CallWithoutOpaque, - Dialyxir.Warnings.CallbackArgumentTypeMismatch, - Dialyxir.Warnings.CallbackInfoMissing, - Dialyxir.Warnings.CallbackMissing, - Dialyxir.Warnings.CallbackNotExported, - Dialyxir.Warnings.CallbackSpecArgumentTypeMismatch, - Dialyxir.Warnings.CallbackSpecTypeMismatch, - Dialyxir.Warnings.CallbackTypeMismatch, - Dialyxir.Warnings.ContractDiff, - Dialyxir.Warnings.ContractRange, - Dialyxir.Warnings.ContractSubtype, - Dialyxir.Warnings.ContractSupertype, - Dialyxir.Warnings.ContractWithOpaque, - Dialyxir.Warnings.ExactEquality, - Dialyxir.Warnings.ExtraRange, - Dialyxir.Warnings.FunctionApplicationArguments, - Dialyxir.Warnings.FunctionApplicationNoFunction, - Dialyxir.Warnings.GuardFail, - Dialyxir.Warnings.GuardFailPattern, - Dialyxir.Warnings.ImproperListConstruction, - Dialyxir.Warnings.InvalidContract, - Dialyxir.Warnings.MapUpdate, - Dialyxir.Warnings.MissingRange, - Dialyxir.Warnings.NegativeGuardFail, - Dialyxir.Warnings.NoReturn, - Dialyxir.Warnings.OpaqueGuard, - Dialyxir.Warnings.OpaqueEquality, - Dialyxir.Warnings.OpaqueMatch, - Dialyxir.Warnings.OpaqueNonequality, - Dialyxir.Warnings.OpaqueTypeTest, - Dialyxir.Warnings.OverlappingContract, - Dialyxir.Warnings.PatternMatch, - Dialyxir.Warnings.PatternMatchCovered, - Dialyxir.Warnings.RecordConstruction, - Dialyxir.Warnings.RecordMatching, - Dialyxir.Warnings.UnknownBehaviour, - Dialyxir.Warnings.UnknownFunction, - Dialyxir.Warnings.UnknownType, - Dialyxir.Warnings.UnmatchedReturn, - Dialyxir.Warnings.UnusedFunction + DialyxirVendored.Warnings.AppCall, + DialyxirVendored.Warnings.Apply, + DialyxirVendored.Warnings.BinaryConstruction, + DialyxirVendored.Warnings.Call, + DialyxirVendored.Warnings.CallToMissingFunction, + DialyxirVendored.Warnings.CallWithOpaque, + DialyxirVendored.Warnings.CallWithoutOpaque, + DialyxirVendored.Warnings.CallbackArgumentTypeMismatch, + DialyxirVendored.Warnings.CallbackInfoMissing, + DialyxirVendored.Warnings.CallbackMissing, + DialyxirVendored.Warnings.CallbackNotExported, + DialyxirVendored.Warnings.CallbackSpecArgumentTypeMismatch, + DialyxirVendored.Warnings.CallbackSpecTypeMismatch, + DialyxirVendored.Warnings.CallbackTypeMismatch, + DialyxirVendored.Warnings.ContractDiff, + DialyxirVendored.Warnings.ContractRange, + DialyxirVendored.Warnings.ContractSubtype, + DialyxirVendored.Warnings.ContractSupertype, + DialyxirVendored.Warnings.ContractWithOpaque, + DialyxirVendored.Warnings.ExactEquality, + DialyxirVendored.Warnings.ExtraRange, + DialyxirVendored.Warnings.FunctionApplicationArguments, + DialyxirVendored.Warnings.FunctionApplicationNoFunction, + DialyxirVendored.Warnings.GuardFail, + DialyxirVendored.Warnings.GuardFailPattern, + DialyxirVendored.Warnings.ImproperListConstruction, + DialyxirVendored.Warnings.InvalidContract, + DialyxirVendored.Warnings.MapUpdate, + DialyxirVendored.Warnings.MissingRange, + DialyxirVendored.Warnings.NegativeGuardFail, + DialyxirVendored.Warnings.NoReturn, + DialyxirVendored.Warnings.OpaqueGuard, + DialyxirVendored.Warnings.OpaqueEquality, + DialyxirVendored.Warnings.OpaqueMatch, + DialyxirVendored.Warnings.OpaqueNonequality, + DialyxirVendored.Warnings.OpaqueTypeTest, + DialyxirVendored.Warnings.OverlappingContract, + DialyxirVendored.Warnings.PatternMatch, + DialyxirVendored.Warnings.PatternMatchCovered, + DialyxirVendored.Warnings.RecordConstruction, + DialyxirVendored.Warnings.RecordMatching, + DialyxirVendored.Warnings.UnknownBehaviour, + DialyxirVendored.Warnings.UnknownFunction, + DialyxirVendored.Warnings.UnknownType, + DialyxirVendored.Warnings.UnmatchedReturn, + DialyxirVendored.Warnings.UnusedFunction ], %{}, fn warning -> {warning.warning(), warning} end diff --git a/lib/dialyxir/warnings/app_call.ex b/lib/dialyxir/warnings/app_call.ex index 9b4bdf5a..2975a1d8 100644 --- a/lib/dialyxir/warnings/app_call.ex +++ b/lib/dialyxir/warnings/app_call.ex @@ -1,17 +1,17 @@ -defmodule Dialyxir.Warnings.AppCall do - @behaviour Dialyxir.Warning +defmodule DialyxirVendored.Warnings.AppCall do + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :app_call def warning(), do: :app_call - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([_module, function | _]) do "Module or function to apply is not an atom in #{function}." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([module, function, arity, culprit, expected_type, actual_type]) do pretty_module = Erlex.pretty_print(module) @@ -22,9 +22,9 @@ defmodule Dialyxir.Warnings.AppCall do "#{culprit} is of type #{pretty_expected_type}, not #{pretty_actual_type}." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do - Dialyxir.Warning.default_explain() + DialyxirVendored.Warning.default_explain() end end diff --git a/lib/dialyxir/warnings/apply.ex b/lib/dialyxir/warnings/apply.ex index 49bd6c51..194dbc9a 100644 --- a/lib/dialyxir/warnings/apply.ex +++ b/lib/dialyxir/warnings/apply.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.Apply do +defmodule DialyxirVendored.Warnings.Apply do @moduledoc """ The function being invoked exists, and has the correct arity, but will not succeed. @@ -13,26 +13,26 @@ defmodule Dialyxir.Warnings.Apply do end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :apply def warning(), do: :apply - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([args | _]) do pretty_args = Erlex.pretty_print_args(args) "Function application with args #{pretty_args} will not succeed." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([args, arg_positions, fail_reason, signature_args, signature_return, contract]) do pretty_args = Erlex.pretty_print_args(args) call_string = - Dialyxir.WarningHelpers.call_or_apply_to_string( + DialyxirVendored.WarningHelpers.call_or_apply_to_string( arg_positions, fail_reason, signature_args, @@ -43,7 +43,7 @@ defmodule Dialyxir.Warnings.Apply do "Function application with arguments #{pretty_args} #{call_string}" end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/binary_construction.ex b/lib/dialyxir/warnings/binary_construction.ex index 1553aa5e..6a50f869 100644 --- a/lib/dialyxir/warnings/binary_construction.ex +++ b/lib/dialyxir/warnings/binary_construction.ex @@ -1,17 +1,17 @@ -defmodule Dialyxir.Warnings.BinaryConstruction do - @behaviour Dialyxir.Warning +defmodule DialyxirVendored.Warnings.BinaryConstruction do + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :bin_construction def warning(), do: :bin_construction - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([culprit | _]) do "Binary construction with #{culprit} will fail." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([culprit, size, segment, type]) do pretty_type = Erlex.pretty_print_type(type) @@ -20,9 +20,9 @@ defmodule Dialyxir.Warnings.BinaryConstruction do "segment #{segment} has type #{pretty_type}." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do - Dialyxir.Warning.default_explain() + DialyxirVendored.Warning.default_explain() end end diff --git a/lib/dialyxir/warnings/call.ex b/lib/dialyxir/warnings/call.ex index d318cbc6..cd81f5d1 100644 --- a/lib/dialyxir/warnings/call.ex +++ b/lib/dialyxir/warnings/call.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.Call do +defmodule DialyxirVendored.Warnings.Call do @moduledoc """ The function call will not succeed. @@ -15,19 +15,19 @@ defmodule Dialyxir.Warnings.Call do end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :call def warning(), do: :call - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([_module, function | _]) do "The function call #{function} will not succeed." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([ module, @@ -43,7 +43,7 @@ defmodule Dialyxir.Warnings.Call do pretty_module = Erlex.pretty_print(module) call_string = - Dialyxir.WarningHelpers.call_or_apply_to_string( + DialyxirVendored.WarningHelpers.call_or_apply_to_string( arg_positions, fail_reason, signature_args, @@ -60,7 +60,7 @@ defmodule Dialyxir.Warnings.Call do """ end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/call_to_missing_function.ex b/lib/dialyxir/warnings/call_to_missing_function.ex index 69b7b9c2..2e9be556 100644 --- a/lib/dialyxir/warnings/call_to_missing_function.ex +++ b/lib/dialyxir/warnings/call_to_missing_function.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.CallToMissingFunction do +defmodule DialyxirVendored.Warnings.CallToMissingFunction do @moduledoc """ Function calls a missing or private function. This may be caused by a typo or incorrect arity. This is also a compiler warning. @@ -22,24 +22,24 @@ defmodule Dialyxir.Warnings.CallToMissingFunction do end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :call_to_missing def warning(), do: :call_to_missing - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short(args), do: format_long(args) - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([module, function, arity]) do pretty_module = Erlex.pretty_print(module) "Call to missing or private function #{pretty_module}.#{function}/#{arity}." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/call_with_opaque.ex b/lib/dialyxir/warnings/call_with_opaque.ex index 411b9ab2..3ca1f827 100644 --- a/lib/dialyxir/warnings/call_with_opaque.ex +++ b/lib/dialyxir/warnings/call_with_opaque.ex @@ -1,17 +1,17 @@ -defmodule Dialyxir.Warnings.CallWithOpaque do - @behaviour Dialyxir.Warning +defmodule DialyxirVendored.Warnings.CallWithOpaque do + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :call_with_opaque def warning(), do: :call_with_opaque - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([_module, function | _]) do "Type mismatch in call with opaque term in #{function}." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([module, function, args, arg_positions, expected_args]) do pretty_module = Erlex.pretty_print(module) @@ -21,12 +21,12 @@ defmodule Dialyxir.Warnings.CallWithOpaque do end defp form_positions(arg_positions = [_]) do - form_position_string = Dialyxir.WarningHelpers.form_position_string(arg_positions) + form_position_string = DialyxirVendored.WarningHelpers.form_position_string(arg_positions) "an opaque term in #{form_position_string} argument" end defp form_positions(arg_positions) do - form_position_string = Dialyxir.WarningHelpers.form_position_string(arg_positions) + form_position_string = DialyxirVendored.WarningHelpers.form_position_string(arg_positions) "opaque terms in #{form_position_string} arguments" end @@ -44,9 +44,9 @@ defmodule Dialyxir.Warnings.CallWithOpaque do "terms of different types are expected in these positions" end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do - Dialyxir.Warning.default_explain() + DialyxirVendored.Warning.default_explain() end end diff --git a/lib/dialyxir/warnings/call_without_opaque.ex b/lib/dialyxir/warnings/call_without_opaque.ex index fb5f434a..5e06f55f 100644 --- a/lib/dialyxir/warnings/call_without_opaque.ex +++ b/lib/dialyxir/warnings/call_without_opaque.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.CallWithoutOpaque do +defmodule DialyxirVendored.Warnings.CallWithoutOpaque do @moduledoc """ Function call without opaqueness type mismatch. @@ -23,19 +23,19 @@ defmodule Dialyxir.Warnings.CallWithoutOpaque do end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :call_without_opaque def warning(), do: :call_without_opaque - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([_module, function | _]) do "Type mismatch in call without opaque term in #{function}." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([module, function, args, expected_triples]) do expected = form_expected_without_opaque(expected_triples) @@ -55,7 +55,7 @@ defmodule Dialyxir.Warnings.CallWithoutOpaque do # the list of triples will never be empty. defp form_expected_without_opaque([{position, type, type_string}]) do pretty_type = Erlex.pretty_print_type(type_string) - form_position_string = Dialyxir.WarningHelpers.form_position_string([position]) + form_position_string = DialyxirVendored.WarningHelpers.form_position_string([position]) if :erl_types.t_is_opaque(type) do "opaque term of type #{pretty_type} in the #{form_position_string} position" @@ -67,11 +67,11 @@ defmodule Dialyxir.Warnings.CallWithoutOpaque do # TODO: can do much better here defp form_expected_without_opaque(expected_triples) do {arg_positions, _typess, _type_strings} = :lists.unzip3(expected_triples) - form_position_string = Dialyxir.WarningHelpers.form_position_string(arg_positions) + form_position_string = DialyxirVendored.WarningHelpers.form_position_string(arg_positions) "opaque terms in the #{form_position_string} position" end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/callback_argument_type_mismatch.ex b/lib/dialyxir/warnings/callback_argument_type_mismatch.ex index 2fb4c592..870a00c2 100644 --- a/lib/dialyxir/warnings/callback_argument_type_mismatch.ex +++ b/lib/dialyxir/warnings/callback_argument_type_mismatch.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.CallbackArgumentTypeMismatch do +defmodule DialyxirVendored.Warnings.CallbackArgumentTypeMismatch do @moduledoc """ Type of argument does not match the callback's expected type. @@ -17,25 +17,25 @@ defmodule Dialyxir.Warnings.CallbackArgumentTypeMismatch do end end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :callback_arg_type_mismatch def warning(), do: :callback_arg_type_mismatch - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([_behaviour, function, arity | _]) do "Type mismatch with behaviour callback to #{function}/#{arity}." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([behaviour, function, arity, position, success_type, callback_type]) do pretty_behaviour = Erlex.pretty_print(behaviour) pretty_success_type = Erlex.pretty_print_type(success_type) pretty_callback_type = Erlex.pretty_print_type(callback_type) - ordinal_position = Dialyxir.WarningHelpers.ordinal(position) + ordinal_position = DialyxirVendored.WarningHelpers.ordinal(position) """ The inferred type for the #{ordinal_position} argument is not a @@ -50,7 +50,7 @@ defmodule Dialyxir.Warnings.CallbackArgumentTypeMismatch do """ end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/callback_info_missing.ex b/lib/dialyxir/warnings/callback_info_missing.ex index c09ca904..f8102cd1 100644 --- a/lib/dialyxir/warnings/callback_info_missing.ex +++ b/lib/dialyxir/warnings/callback_info_missing.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.CallbackInfoMissing do +defmodule DialyxirVendored.Warnings.CallbackInfoMissing do @moduledoc """ The module is using a behaviour that does not exist or is not a behaviour. This is also a compiler warning. @@ -14,17 +14,17 @@ defmodule Dialyxir.Warnings.CallbackInfoMissing do end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :callback_info_missing def warning(), do: :callback_info_missing - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short(args), do: format_long(args) - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([behaviour]) do pretty_behaviour = Erlex.pretty_print(behaviour) @@ -32,7 +32,7 @@ defmodule Dialyxir.Warnings.CallbackInfoMissing do "Callback info about the #{pretty_behaviour} behaviour is not available." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/callback_missing.ex b/lib/dialyxir/warnings/callback_missing.ex index 322e137f..268eb1e2 100644 --- a/lib/dialyxir/warnings/callback_missing.ex +++ b/lib/dialyxir/warnings/callback_missing.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.CallbackMissing do +defmodule DialyxirVendored.Warnings.CallbackMissing do @moduledoc """ Module implements a behaviour, but does not have all of its callbacks. This is also a compiler warning. @@ -19,17 +19,17 @@ defmodule Dialyxir.Warnings.CallbackMissing do end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :callback_missing def warning(), do: :callback_missing - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short(args), do: format_long(args) - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([behaviour, function, arity]) do pretty_behaviour = Erlex.pretty_print(behaviour) @@ -37,7 +37,7 @@ defmodule Dialyxir.Warnings.CallbackMissing do "Undefined callback function #{function}/#{arity} (behaviour #{pretty_behaviour})." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/callback_not_exported.ex b/lib/dialyxir/warnings/callback_not_exported.ex index c1f8da3f..da8037e2 100644 --- a/lib/dialyxir/warnings/callback_not_exported.ex +++ b/lib/dialyxir/warnings/callback_not_exported.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.CallbackNotExported do +defmodule DialyxirVendored.Warnings.CallbackNotExported do @moduledoc """ Module implements a behaviour, but does not export some of its callbacks. @@ -31,17 +31,17 @@ defmodule Dialyxir.Warnings.CallbackNotExported do end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :callback_not_exported def warning(), do: :callback_not_exported - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short(args), do: format_long(args) - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([behaviour, function, arity]) do pretty_behaviour = Erlex.pretty_print(behaviour) @@ -49,7 +49,7 @@ defmodule Dialyxir.Warnings.CallbackNotExported do "Callback function #{function}/#{arity} exists but is not exported (behaviour #{pretty_behaviour})." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/callback_spec_argument_type_mismatch.ex b/lib/dialyxir/warnings/callback_spec_argument_type_mismatch.ex index bf124f16..c3922fbe 100644 --- a/lib/dialyxir/warnings/callback_spec_argument_type_mismatch.ex +++ b/lib/dialyxir/warnings/callback_spec_argument_type_mismatch.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.CallbackSpecArgumentTypeMismatch do +defmodule DialyxirVendored.Warnings.CallbackSpecArgumentTypeMismatch do @moduledoc """ Spec type of argument does not match the callback's expected type. @@ -18,25 +18,25 @@ defmodule Dialyxir.Warnings.CallbackSpecArgumentTypeMismatch do end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :callback_spec_arg_type_mismatch def warning(), do: :callback_spec_arg_type_mismatch - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([_behaviour, function | _]) do "Spec type mismatch in argument to callback #{function}." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([behaviour, function, arity, position, success_type, callback_type]) do pretty_behaviour = Erlex.pretty_print(behaviour) pretty_success_type = Erlex.pretty_print_type(success_type) pretty_callback_type = Erlex.pretty_print_type(callback_type) - ordinal_position = Dialyxir.WarningHelpers.ordinal(position) + ordinal_position = DialyxirVendored.WarningHelpers.ordinal(position) """ The @spec type for the #{ordinal_position} argument is not a @@ -51,7 +51,7 @@ defmodule Dialyxir.Warnings.CallbackSpecArgumentTypeMismatch do """ end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/callback_spec_type_mismatch.ex b/lib/dialyxir/warnings/callback_spec_type_mismatch.ex index c9eac9f6..7d4709f2 100644 --- a/lib/dialyxir/warnings/callback_spec_type_mismatch.ex +++ b/lib/dialyxir/warnings/callback_spec_type_mismatch.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.CallbackSpecTypeMismatch do +defmodule DialyxirVendored.Warnings.CallbackSpecTypeMismatch do @moduledoc """ The return type in the @spec does not match the expected return type of the behaviour. @@ -19,19 +19,19 @@ defmodule Dialyxir.Warnings.CallbackSpecTypeMismatch do end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :callback_spec_type_mismatch def warning(), do: :callback_spec_type_mismatch - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([_behaviour, function | _]) do "The @spec return type does not match the expected return type for #{function}." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([behaviour, function, arity, success_type, callback_type]) do pretty_behaviour = Erlex.pretty_print(behaviour) @@ -50,7 +50,7 @@ defmodule Dialyxir.Warnings.CallbackSpecTypeMismatch do """ end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/callback_type_mismatch.ex b/lib/dialyxir/warnings/callback_type_mismatch.ex index 34ff6b7e..2e222e32 100644 --- a/lib/dialyxir/warnings/callback_type_mismatch.ex +++ b/lib/dialyxir/warnings/callback_type_mismatch.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.CallbackTypeMismatch do +defmodule DialyxirVendored.Warnings.CallbackTypeMismatch do @moduledoc """ The success type of the function does not match the callback type in the behaviour. @@ -18,19 +18,19 @@ defmodule Dialyxir.Warnings.CallbackTypeMismatch do end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :callback_type_mismatch def warning(), do: :callback_type_mismatch - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([_behaviour, function | _]) do "Type mismatch for @callback #{function}." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t() | non_neg_integer]) :: String.t() def format_long([behaviour, function, arity, fail_type, success_type]) do pretty_behaviour = Erlex.pretty_print(behaviour) @@ -48,7 +48,7 @@ defmodule Dialyxir.Warnings.CallbackTypeMismatch do """ end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/contract_diff.ex b/lib/dialyxir/warnings/contract_diff.ex index 804529a6..2f6ca221 100644 --- a/lib/dialyxir/warnings/contract_diff.ex +++ b/lib/dialyxir/warnings/contract_diff.ex @@ -1,17 +1,17 @@ -defmodule Dialyxir.Warnings.ContractDiff do - @behaviour Dialyxir.Warning +defmodule DialyxirVendored.Warnings.ContractDiff do + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :contract_diff def warning(), do: :contract_diff - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([_module, function | _]) do "Type specification is not equal to the success typing for #{function}." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([module, function, arity, contract, signature]) do pretty_module = Erlex.pretty_print(module) @@ -32,9 +32,9 @@ defmodule Dialyxir.Warnings.ContractDiff do """ end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do - Dialyxir.Warning.default_explain() + DialyxirVendored.Warning.default_explain() end end diff --git a/lib/dialyxir/warnings/contract_range.ex b/lib/dialyxir/warnings/contract_range.ex index 10c3b4ae..b7442575 100644 --- a/lib/dialyxir/warnings/contract_range.ex +++ b/lib/dialyxir/warnings/contract_range.ex @@ -1,17 +1,17 @@ -defmodule Dialyxir.Warnings.ContractRange do - @behaviour Dialyxir.Warning +defmodule DialyxirVendored.Warnings.ContractRange do + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :contract_range def warning(), do: :contract_range - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([_, _, function | _]) do "Contract cannot be correct because return type for #{function} is mismatched." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([contract, module, function, arg_strings, line, contract_return]) do pretty_contract = Erlex.pretty_print_contract(contract) @@ -33,9 +33,9 @@ defmodule Dialyxir.Warnings.ContractRange do """ end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do - Dialyxir.Warning.default_explain() + DialyxirVendored.Warning.default_explain() end end diff --git a/lib/dialyxir/warnings/contract_subtype.ex b/lib/dialyxir/warnings/contract_subtype.ex index 30f4d660..5ad48db5 100644 --- a/lib/dialyxir/warnings/contract_subtype.ex +++ b/lib/dialyxir/warnings/contract_subtype.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.ContractSubtype do +defmodule DialyxirVendored.Warnings.ContractSubtype do # TODO: could not create warning with this example (and --overspecs) @moduledoc """ The type in the @spec does not completely cover the types returned @@ -18,19 +18,19 @@ defmodule Dialyxir.Warnings.ContractSubtype do end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :contract_subtype def warning(), do: :contract_subtype - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([_module, function | _]) do "Type specification for #{function} is a subtype of the success typing." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([module, function, arity, contract, signature]) do pretty_module = Erlex.pretty_print(module) @@ -51,7 +51,7 @@ defmodule Dialyxir.Warnings.ContractSubtype do """ end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/contract_supertype.ex b/lib/dialyxir/warnings/contract_supertype.ex index ff711bc2..070c3b13 100644 --- a/lib/dialyxir/warnings/contract_supertype.ex +++ b/lib/dialyxir/warnings/contract_supertype.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.ContractSupertype do +defmodule DialyxirVendored.Warnings.ContractSupertype do @moduledoc """ The @spec, while not incorrect, is more general than the type returned by the function. @@ -13,19 +13,19 @@ defmodule Dialyxir.Warnings.ContractSupertype do end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :contract_supertype def warning(), do: :contract_supertype - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([_module, function | _]) do "Type specification for #{function} is a supertype of the success typing." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([module, function, arity, contract, signature]) do pretty_module = Erlex.pretty_print(module) @@ -46,7 +46,7 @@ defmodule Dialyxir.Warnings.ContractSupertype do """ end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/contract_with_opaque.ex b/lib/dialyxir/warnings/contract_with_opaque.ex index a517b996..47b486c4 100644 --- a/lib/dialyxir/warnings/contract_with_opaque.ex +++ b/lib/dialyxir/warnings/contract_with_opaque.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.ContractWithOpaque do +defmodule DialyxirVendored.Warnings.ContractWithOpaque do @moduledoc """ The @spec says the function is returning an opaque type, but it is returning a different type. @@ -17,19 +17,19 @@ defmodule Dialyxir.Warnings.ContractWithOpaque do end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :contract_with_opaque def warning(), do: :contract_with_opaque - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([_module, function | _]) do "The @spec for #{function} has an opaque subtype which is violated by the success typing." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([module, function, arity, type, signature_type]) do pretty_module = Erlex.pretty_print(module) @@ -45,7 +45,7 @@ defmodule Dialyxir.Warnings.ContractWithOpaque do """ end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/exact_equality.ex b/lib/dialyxir/warnings/exact_equality.ex index 6b6331ee..21903958 100644 --- a/lib/dialyxir/warnings/exact_equality.ex +++ b/lib/dialyxir/warnings/exact_equality.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.ExactEquality do +defmodule DialyxirVendored.Warnings.ExactEquality do @moduledoc """ The expression can never evaluate to true. @@ -11,17 +11,17 @@ defmodule Dialyxir.Warnings.ExactEquality do end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :exact_eq def warning(), do: :exact_eq - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short(args), do: format_long(args) - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([type1, op, type2]) do pretty_type1 = Erlex.pretty_print_type(type1) @@ -30,7 +30,7 @@ defmodule Dialyxir.Warnings.ExactEquality do "The test #{pretty_type1} #{op} #{pretty_type2} can never evaluate to 'true'." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/extra_range.ex b/lib/dialyxir/warnings/extra_range.ex index 6764b21a..2c2b0819 100644 --- a/lib/dialyxir/warnings/extra_range.ex +++ b/lib/dialyxir/warnings/extra_range.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.ExtraRange do +defmodule DialyxirVendored.Warnings.ExtraRange do @moduledoc """ The @spec says the function returns more types than the function actually returns. @@ -13,19 +13,19 @@ defmodule Dialyxir.Warnings.ExtraRange do end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :extra_range def warning(), do: :extra_range - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([_module, function | _]) do "@spec for #{function} has more types than are returned by the function." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([module, function, arity, extra_ranges, signature_range]) do pretty_module = Erlex.pretty_print(module) @@ -46,7 +46,7 @@ defmodule Dialyxir.Warnings.ExtraRange do """ end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/function_application_arguments.ex b/lib/dialyxir/warnings/function_application_arguments.ex index d6cc101c..23553c25 100644 --- a/lib/dialyxir/warnings/function_application_arguments.ex +++ b/lib/dialyxir/warnings/function_application_arguments.ex @@ -1,11 +1,11 @@ -defmodule Dialyxir.Warnings.FunctionApplicationArguments do - @behaviour Dialyxir.Warning +defmodule DialyxirVendored.Warnings.FunctionApplicationArguments do + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :fun_app_args def warning(), do: :fun_app_args - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([args, _type]) do pretty_args = Erlex.pretty_print_args(args) @@ -17,7 +17,7 @@ defmodule Dialyxir.Warnings.FunctionApplicationArguments do format_short([args, type]) end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([args, type]) do pretty_args = Erlex.pretty_print_args(args) @@ -39,18 +39,18 @@ defmodule Dialyxir.Warnings.FunctionApplicationArguments do end defp form_positions(arg_positions = [_]) do - form_position_string = Dialyxir.WarningHelpers.form_position_string(arg_positions) + form_position_string = DialyxirVendored.WarningHelpers.form_position_string(arg_positions) "the #{form_position_string} argument" end defp form_positions(arg_positions) do - form_position_string = Dialyxir.WarningHelpers.form_position_string(arg_positions) + form_position_string = DialyxirVendored.WarningHelpers.form_position_string(arg_positions) "the #{form_position_string} arguments" end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do - Dialyxir.Warning.default_explain() + DialyxirVendored.Warning.default_explain() end end diff --git a/lib/dialyxir/warnings/function_application_no_function.ex b/lib/dialyxir/warnings/function_application_no_function.ex index f776f5b1..9ce97f44 100644 --- a/lib/dialyxir/warnings/function_application_no_function.ex +++ b/lib/dialyxir/warnings/function_application_no_function.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.FunctionApplicationNoFunction do +defmodule DialyxirVendored.Warnings.FunctionApplicationNoFunction do @moduledoc """ The function being invoked exists, but has an arity mismatch. @@ -12,19 +12,19 @@ defmodule Dialyxir.Warnings.FunctionApplicationNoFunction do end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :fun_app_no_fun def warning(), do: :fun_app_no_fun - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([_, _, arity]) do "Function application will fail, because anonymous function has arity of #{arity}." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([op, type, arity]) do pretty_op = Erlex.pretty_print(op) @@ -33,7 +33,7 @@ defmodule Dialyxir.Warnings.FunctionApplicationNoFunction do "Function application will fail, because #{pretty_op} :: #{pretty_type} is not a function of arity #{arity}." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/guard_fail.ex b/lib/dialyxir/warnings/guard_fail.ex index 1860acc6..dc26e5ed 100644 --- a/lib/dialyxir/warnings/guard_fail.ex +++ b/lib/dialyxir/warnings/guard_fail.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.GuardFail do +defmodule DialyxirVendored.Warnings.GuardFail do @moduledoc """ The function guard either presents an impossible guard or the only calls will never succeed against the guards. @@ -24,19 +24,19 @@ defmodule Dialyxir.Warnings.GuardFail do end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :guard_fail def warning(), do: :guard_fail - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short(_) do "The guard clause can never succeed." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([]) do "The guard clause can never succeed." @@ -68,7 +68,7 @@ defmodule Dialyxir.Warnings.GuardFail do """ end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/guard_fail_pattern.ex b/lib/dialyxir/warnings/guard_fail_pattern.ex index ef9bccb5..1eba4cd5 100644 --- a/lib/dialyxir/warnings/guard_fail_pattern.ex +++ b/lib/dialyxir/warnings/guard_fail_pattern.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.GuardFailPattern do +defmodule DialyxirVendored.Warnings.GuardFailPattern do @moduledoc """ The clause guard describes a condition of literals that fails the pattern given in the function head. @@ -12,19 +12,19 @@ defmodule Dialyxir.Warnings.GuardFailPattern do end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :guard_fail_pat def warning(), do: :guard_fail_pat - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([pattern, _]) do "The clause guard #{pattern} cannot succeed." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([pattern, type]) do pretty_type = Erlex.pretty_print_type(type) @@ -34,7 +34,7 @@ defmodule Dialyxir.Warnings.GuardFailPattern do "was matched against the type #{pretty_type}." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/improper_list_construction.ex b/lib/dialyxir/warnings/improper_list_construction.ex index 5692418e..1e877cce 100644 --- a/lib/dialyxir/warnings/improper_list_construction.ex +++ b/lib/dialyxir/warnings/improper_list_construction.ex @@ -1,15 +1,15 @@ -defmodule Dialyxir.Warnings.ImproperListConstruction do - @behaviour Dialyxir.Warning +defmodule DialyxirVendored.Warnings.ImproperListConstruction do + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :improper_list_constr def warning(), do: :improper_list_constr - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short(args), do: format_long(args) - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([tl_type]) do pretty_type = Erlex.pretty_print_type(tl_type) @@ -18,9 +18,9 @@ defmodule Dialyxir.Warnings.ImproperListConstruction do "because its second argument is #{pretty_type}." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do - Dialyxir.Warning.default_explain() + DialyxirVendored.Warning.default_explain() end end diff --git a/lib/dialyxir/warnings/invalid_contract.ex b/lib/dialyxir/warnings/invalid_contract.ex index c16e68c9..638ff624 100644 --- a/lib/dialyxir/warnings/invalid_contract.ex +++ b/lib/dialyxir/warnings/invalid_contract.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.InvalidContract do +defmodule DialyxirVendored.Warnings.InvalidContract do @moduledoc """ The @spec for the function does not match the success typing of the function. @@ -17,19 +17,19 @@ defmodule Dialyxir.Warnings.InvalidContract do mismatch. """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :invalid_contract def warning(), do: :invalid_contract - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([_module, function | _]) do "Invalid type specification for function #{function}." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([module, function, arity, signature]) do pretty_module = Erlex.pretty_print(module) @@ -46,7 +46,7 @@ defmodule Dialyxir.Warnings.InvalidContract do """ end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/map_update.ex b/lib/dialyxir/warnings/map_update.ex index 5b52af8e..eefb6790 100644 --- a/lib/dialyxir/warnings/map_update.ex +++ b/lib/dialyxir/warnings/map_update.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.MapUpdate do +defmodule DialyxirVendored.Warnings.MapUpdate do @moduledoc """ Elixir can only use the map update syntax to update a key that is in the map. @@ -14,20 +14,20 @@ defmodule Dialyxir.Warnings.MapUpdate do end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :map_update def warning(), do: :map_update - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([_map, key]) do pretty_key = Erlex.pretty_print(key) "Attempted to update key #{pretty_key} in a map that does not have that key." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([map, key]) do pretty_key = Erlex.pretty_print(key) @@ -44,7 +44,7 @@ defmodule Dialyxir.Warnings.MapUpdate do """ end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/missing_range.ex b/lib/dialyxir/warnings/missing_range.ex index 93fd55cc..763cefca 100644 --- a/lib/dialyxir/warnings/missing_range.ex +++ b/lib/dialyxir/warnings/missing_range.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.MissingRange do +defmodule DialyxirVendored.Warnings.MissingRange do @moduledoc """ Function spec declares a list of types, but function returns value outside stated range. @@ -19,13 +19,13 @@ defmodule Dialyxir.Warnings.MissingRange do end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :missing_range def warning(), do: :missing_range - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([module, function, arity | _]) do pretty_module = Erlex.pretty_print(module) @@ -33,7 +33,7 @@ defmodule Dialyxir.Warnings.MissingRange do "The type specification is missing types returned by #{pretty_module}.#{function}/#{arity}." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([module, function, arity, extra_ranges, contract_range]) do pretty_module = Erlex.pretty_print(module) @@ -54,7 +54,7 @@ defmodule Dialyxir.Warnings.MissingRange do """ end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/negative_guard_fail.ex b/lib/dialyxir/warnings/negative_guard_fail.ex index 7ad51d01..8fd8b97b 100644 --- a/lib/dialyxir/warnings/negative_guard_fail.ex +++ b/lib/dialyxir/warnings/negative_guard_fail.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.NegativeGuardFail do +defmodule DialyxirVendored.Warnings.NegativeGuardFail do @moduledoc """ The function guard either presents an impossible guard or the only calls will never succeed against the guards. @@ -24,19 +24,19 @@ defmodule Dialyxir.Warnings.NegativeGuardFail do end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :neg_guard_fail def warning(), do: :neg_guard_fail - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short(_) do "The guard test can never succeed." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([guard, args]) do pretty_args = Erlex.pretty_print_args(args) @@ -60,7 +60,7 @@ defmodule Dialyxir.Warnings.NegativeGuardFail do """ end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/no_return.ex b/lib/dialyxir/warnings/no_return.ex index 966e6ac3..5edb2167 100644 --- a/lib/dialyxir/warnings/no_return.ex +++ b/lib/dialyxir/warnings/no_return.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.NoReturn do +defmodule DialyxirVendored.Warnings.NoReturn do @moduledoc """ The function has no return. This is usually due to an issue later on in the call stack causing it to not be recognized as returning for @@ -30,17 +30,17 @@ defmodule Dialyxir.Warnings.NoReturn do end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :no_return def warning(), do: :no_return - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short(args), do: format_long(args) - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t() | atom]) :: String.t() def format_long([type | name]) do name_string = @@ -70,7 +70,7 @@ defmodule Dialyxir.Warnings.NoReturn do "#{name_string} #{type_string}" end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/opaque_equality.ex b/lib/dialyxir/warnings/opaque_equality.ex index 1fd1ae77..fccb1e04 100644 --- a/lib/dialyxir/warnings/opaque_equality.ex +++ b/lib/dialyxir/warnings/opaque_equality.ex @@ -1,11 +1,11 @@ -defmodule Dialyxir.Warnings.OpaqueEquality do - @behaviour Dialyxir.Warning +defmodule DialyxirVendored.Warnings.OpaqueEquality do + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :opaque_eq def warning(), do: :opaque_eq - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([_type, _op, opaque_type]) do pretty_opaque_type = opaque_type |> Erlex.pretty_print() |> unqualify_module() @@ -24,7 +24,7 @@ defmodule Dialyxir.Warnings.OpaqueEquality do end end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([type, _op, opaque_type]) do pretty_opaque_type = Erlex.pretty_print_type(opaque_type) @@ -33,9 +33,9 @@ defmodule Dialyxir.Warnings.OpaqueEquality do "and a term of opaque type #{pretty_opaque_type}." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do - Dialyxir.Warning.default_explain() + DialyxirVendored.Warning.default_explain() end end diff --git a/lib/dialyxir/warnings/opaque_guard.ex b/lib/dialyxir/warnings/opaque_guard.ex index a198bf2e..1444ccb8 100644 --- a/lib/dialyxir/warnings/opaque_guard.ex +++ b/lib/dialyxir/warnings/opaque_guard.ex @@ -1,25 +1,25 @@ -defmodule Dialyxir.Warnings.OpaqueGuard do - @behaviour Dialyxir.Warning +defmodule DialyxirVendored.Warnings.OpaqueGuard do + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :opaque_guard def warning(), do: :opaque_guard - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([guard | _]) do "The guard test #{guard} breaks the opaqueness of its argument." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([guard, args]) do "The guard test #{guard}#{args} breaks the opaqueness of its argument." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do - Dialyxir.Warning.default_explain() + DialyxirVendored.Warning.default_explain() end end diff --git a/lib/dialyxir/warnings/opaque_match.ex b/lib/dialyxir/warnings/opaque_match.ex index fb6f9a0e..c15887cd 100644 --- a/lib/dialyxir/warnings/opaque_match.ex +++ b/lib/dialyxir/warnings/opaque_match.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.OpaqueMatch do +defmodule DialyxirVendored.Warnings.OpaqueMatch do @moduledoc """ Attempted to pattern match against the internal structure of an opaque term. @@ -25,13 +25,13 @@ defmodule Dialyxir.Warnings.OpaqueMatch do end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :opaque_match def warning(), do: :opaque_match - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([_pattern, type | _]) do pretty_type = Erlex.pretty_print_type(type) @@ -39,7 +39,7 @@ defmodule Dialyxir.Warnings.OpaqueMatch do "Attempted to pattern match against the internal structure of an opaque term of type #{pretty_type}." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([pattern, opaque_type, opaque_term]) do pretty_opaque_term = Erlex.pretty_print(opaque_term) @@ -66,7 +66,7 @@ defmodule Dialyxir.Warnings.OpaqueMatch do """ end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/opaque_nonequality.ex b/lib/dialyxir/warnings/opaque_nonequality.ex index ba9c70f8..aaea4ffc 100644 --- a/lib/dialyxir/warnings/opaque_nonequality.ex +++ b/lib/dialyxir/warnings/opaque_nonequality.ex @@ -1,26 +1,26 @@ -defmodule Dialyxir.Warnings.OpaqueNonequality do - @behaviour Dialyxir.Warning +defmodule DialyxirVendored.Warnings.OpaqueNonequality do + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :opaque_neq def warning(), do: :opaque_neq - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([type, _op, opaque_type]) do "Attempted to test for inequality between #{type} and opaque type #{opaque_type}." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([type, _op, opaque_type]) do "Attempt to test for inequality between a term of type #{type} " <> "and a term of opaque type #{opaque_type}." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do - Dialyxir.Warning.default_explain() + DialyxirVendored.Warning.default_explain() end end diff --git a/lib/dialyxir/warnings/opaque_type_test.ex b/lib/dialyxir/warnings/opaque_type_test.ex index 384f20a2..ea52ff20 100644 --- a/lib/dialyxir/warnings/opaque_type_test.ex +++ b/lib/dialyxir/warnings/opaque_type_test.ex @@ -1,25 +1,25 @@ -defmodule Dialyxir.Warnings.OpaqueTypeTest do - @behaviour Dialyxir.Warning +defmodule DialyxirVendored.Warnings.OpaqueTypeTest do + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :opaque_type_test def warning(), do: :opaque_type_test - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([function, _opaque]) do "The type test in #{function} breaks the opaqueness of the term." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([function, opaque]) do "The type test #{function}(#{opaque}) breaks the opaqueness of the term #{opaque}." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do - Dialyxir.Warning.default_explain() + DialyxirVendored.Warning.default_explain() end end diff --git a/lib/dialyxir/warnings/overlapping_contract.ex b/lib/dialyxir/warnings/overlapping_contract.ex index e7642b25..ecf2573e 100644 --- a/lib/dialyxir/warnings/overlapping_contract.ex +++ b/lib/dialyxir/warnings/overlapping_contract.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.OverlappingContract do +defmodule DialyxirVendored.Warnings.OverlappingContract do @moduledoc """ The function has an additional @spec that is already covered more generally by a higher @spec. @@ -17,25 +17,25 @@ defmodule Dialyxir.Warnings.OverlappingContract do end end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :overlapping_contract def warning(), do: :overlapping_contract - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([_module, function, arity]) do "The contract for #{function}/#{arity} is overloaded." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([module, function, arity]) do pretty_module = Erlex.pretty_print(module) diff --git a/lib/dialyxir/warnings/pattern_match.ex b/lib/dialyxir/warnings/pattern_match.ex index c1708536..fe21e32c 100644 --- a/lib/dialyxir/warnings/pattern_match.ex +++ b/lib/dialyxir/warnings/pattern_match.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.PatternMatch do +defmodule DialyxirVendored.Warnings.PatternMatch do @moduledoc """ The pattern matching is never given a value that satisfies all of its clauses. @@ -16,20 +16,20 @@ defmodule Dialyxir.Warnings.PatternMatch do end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :pattern_match def warning(), do: :pattern_match - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([_pattern, type]) do pretty_type = Erlex.pretty_print_type(type) "The pattern can never match the type #{pretty_type}." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([pattern, type]) do pretty_pattern = Erlex.pretty_print_pattern(pattern) @@ -46,7 +46,7 @@ defmodule Dialyxir.Warnings.PatternMatch do """ end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/pattern_match_covered.ex b/lib/dialyxir/warnings/pattern_match_covered.ex index 231802bc..2226391b 100644 --- a/lib/dialyxir/warnings/pattern_match_covered.ex +++ b/lib/dialyxir/warnings/pattern_match_covered.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.PatternMatchCovered do +defmodule DialyxirVendored.Warnings.PatternMatchCovered do @moduledoc """ The pattern match has a later clause that will never be executed, because a more general clause is higher in the matching order. @@ -16,20 +16,20 @@ defmodule Dialyxir.Warnings.PatternMatchCovered do end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :pattern_match_cov def warning(), do: :pattern_match_cov - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([pattern, _]) do "The pattern #{pattern} can never match the type, " <> "because it is covered by previous clauses." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([pattern, type]) do pretty_pattern = Erlex.pretty_print_pattern(pattern) @@ -44,7 +44,7 @@ defmodule Dialyxir.Warnings.PatternMatchCovered do """ end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/record_construction.ex b/lib/dialyxir/warnings/record_construction.ex index d992eec0..64789bcb 100644 --- a/lib/dialyxir/warnings/record_construction.ex +++ b/lib/dialyxir/warnings/record_construction.ex @@ -1,17 +1,17 @@ -defmodule Dialyxir.Warnings.RecordConstruction do - @behaviour Dialyxir.Warning +defmodule DialyxirVendored.Warnings.RecordConstruction do + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :record_constr def warning(), do: :record_constr - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do - Dialyxir.Warning.default_explain() + DialyxirVendored.Warning.default_explain() end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short([_types, name]) do "Record construction violates the declared type for #{name}." @@ -21,7 +21,7 @@ defmodule Dialyxir.Warnings.RecordConstruction do "Record construction violates the declared type for #{name}." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([types, name]) do "Record construction #{types} violates the declared type for ##{name}{}." diff --git a/lib/dialyxir/warnings/record_matching.ex b/lib/dialyxir/warnings/record_matching.ex index 1a81c442..b66da904 100644 --- a/lib/dialyxir/warnings/record_matching.ex +++ b/lib/dialyxir/warnings/record_matching.ex @@ -1,23 +1,23 @@ -defmodule Dialyxir.Warnings.RecordMatching do - @behaviour Dialyxir.Warning +defmodule DialyxirVendored.Warnings.RecordMatching do + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :record_matching def warning(), do: :record_matching - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short(args), do: format_long(args) - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([string, name]) do "The #{string} violates the declared type for ##{name}{}." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do - Dialyxir.Warning.default_explain() + DialyxirVendored.Warning.default_explain() end end diff --git a/lib/dialyxir/warnings/unknown_behaviour.ex b/lib/dialyxir/warnings/unknown_behaviour.ex index 5fd1075a..075fda42 100644 --- a/lib/dialyxir/warnings/unknown_behaviour.ex +++ b/lib/dialyxir/warnings/unknown_behaviour.ex @@ -1,15 +1,15 @@ -defmodule Dialyxir.Warnings.UnknownBehaviour do - @behaviour Dialyxir.Warning +defmodule DialyxirVendored.Warnings.UnknownBehaviour do + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :unknown_behaviour def warning(), do: :unknown_behaviour - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short(String.t()) :: String.t() def format_short(args), do: format_long(args) - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long(String.t()) :: String.t() def format_long(behaviour) do pretty_module = Erlex.pretty_print(behaviour) @@ -17,9 +17,9 @@ defmodule Dialyxir.Warnings.UnknownBehaviour do "Unknown behaviour: #{pretty_module}." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do - Dialyxir.Warning.default_explain() + DialyxirVendored.Warning.default_explain() end end diff --git a/lib/dialyxir/warnings/unknown_function.ex b/lib/dialyxir/warnings/unknown_function.ex index 5095865a..ebca814a 100644 --- a/lib/dialyxir/warnings/unknown_function.ex +++ b/lib/dialyxir/warnings/unknown_function.ex @@ -1,27 +1,27 @@ -defmodule Dialyxir.Warnings.UnknownFunction do - @behaviour Dialyxir.Warning +defmodule DialyxirVendored.Warnings.UnknownFunction do + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :unknown_function def warning(), do: :unknown_function - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short({String.t(), String.t(), String.t()}) :: String.t() def format_short({module, function, arity}) do pretty_module = Erlex.pretty_print(module) "Function #{pretty_module}.#{function}/#{arity} does not exist." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long({String.t(), String.t(), String.t()}) :: String.t() def format_long({module, function, arity}) do pretty_module = Erlex.pretty_print(module) "Function #{pretty_module}.#{function}/#{arity} does not exist." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do - Dialyxir.Warning.default_explain() + DialyxirVendored.Warning.default_explain() end end diff --git a/lib/dialyxir/warnings/unknown_type.ex b/lib/dialyxir/warnings/unknown_type.ex index f851a01c..cb377bd1 100644 --- a/lib/dialyxir/warnings/unknown_type.ex +++ b/lib/dialyxir/warnings/unknown_type.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.UnknownType do +defmodule DialyxirVendored.Warnings.UnknownType do @moduledoc """ Spec references a missing @type. @@ -15,13 +15,13 @@ defmodule Dialyxir.Warnings.UnknownType do end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :unknown_type def warning(), do: :unknown_type - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short({String.t(), String.t(), String.t()}) :: String.t() def format_short({module, function, arity}) do pretty_module = Erlex.pretty_print(module) @@ -29,13 +29,13 @@ defmodule Dialyxir.Warnings.UnknownType do "Unknown type: #{pretty_module}.#{function}/#{arity}." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long({String.t(), String.t(), String.t()}) :: String.t() def format_long({module, function, arity}) do format_short({module, function, arity}) end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/unmatched_return.ex b/lib/dialyxir/warnings/unmatched_return.ex index f7d08f4d..e053b5b0 100644 --- a/lib/dialyxir/warnings/unmatched_return.ex +++ b/lib/dialyxir/warnings/unmatched_return.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.UnmatchedReturn do +defmodule DialyxirVendored.Warnings.UnmatchedReturn do @moduledoc """ The invoked expression returns a union of types and the call does not match on its return types using e.g. a case or wildcard. @@ -47,19 +47,19 @@ defmodule Dialyxir.Warnings.UnmatchedReturn do end end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :unmatched_return def warning(), do: :unmatched_return - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short(_) do "The expression produces multiple types, but none are matched." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([type]) do pretty_type = Erlex.pretty_print_type(type) @@ -73,7 +73,7 @@ defmodule Dialyxir.Warnings.UnmatchedReturn do """ end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/dialyxir/warnings/unused_function.ex b/lib/dialyxir/warnings/unused_function.ex index 7a6d14cb..b90add20 100644 --- a/lib/dialyxir/warnings/unused_function.ex +++ b/lib/dialyxir/warnings/unused_function.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Warnings.UnusedFunction do +defmodule DialyxirVendored.Warnings.UnusedFunction do @moduledoc """ Due to issues higher in the function or call stack, while the function is recognized as used by the compiler, it will never be @@ -17,23 +17,23 @@ defmodule Dialyxir.Warnings.UnusedFunction do end """ - @behaviour Dialyxir.Warning + @behaviour DialyxirVendored.Warning - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec warning() :: :unused_fun def warning(), do: :unused_fun - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_short([String.t()]) :: String.t() def format_short(args), do: format_long(args) - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec format_long([String.t()]) :: String.t() def format_long([function, arity]) do "Function #{function}/#{arity} will never be called." end - @impl Dialyxir.Warning + @impl DialyxirVendored.Warning @spec explain() :: String.t() def explain() do @moduledoc diff --git a/lib/mix/tasks/dialyzer.ex b/lib/mix/tasks/dialyzer.ex index 9d240ab1..ceeb83f4 100644 --- a/lib/mix/tasks/dialyzer.ex +++ b/lib/mix/tasks/dialyzer.ex @@ -1,4 +1,4 @@ -defmodule Mix.Tasks.Dialyzer do +defmodule Mix.Tasks.DialyzerVendored do @shortdoc "Runs dialyzer with default or project-defined flags." @moduledoc """ @@ -94,10 +94,10 @@ defmodule Mix.Tasks.Dialyzer do use Mix.Task import System, only: [user_home!: 0] - import Dialyxir.Output, only: [info: 1, error: 1] - alias Dialyxir.Project - alias Dialyxir.Plt - alias Dialyxir.Dialyzer + import DialyxirVendored.Output, only: [info: 1, error: 1] + alias DialyxirVendored.Project + alias DialyxirVendored.Plt + alias DialyxirVendored.Dialyzer defmodule Build do @shortdoc "Build the required PLT(s) and exit." @@ -113,7 +113,7 @@ defmodule Mix.Tasks.Dialyzer do use Mix.Task def run(args) do - Mix.Tasks.Dialyzer.run(["--plt" | args]) + Mix.Tasks.DialyzerVendored.run(["--plt" | args]) end end @@ -132,7 +132,7 @@ defmodule Mix.Tasks.Dialyzer do @command_options [all: :boolean] def run(args) do {opts, _, _dargs} = OptionParser.parse(args, strict: @command_options) - Mix.Tasks.Dialyzer.clean(opts) + Mix.Tasks.DialyzerVendored.clean(opts) end end @@ -174,8 +174,8 @@ defmodule Mix.Tasks.Dialyzer do check_plt(force_check?) end - default = Dialyxir.Project.default_ignore_warnings() - ignore_warnings = Dialyxir.Project.dialyzer_ignore_warnings() + default = DialyxirVendored.Project.default_ignore_warnings() + ignore_warnings = DialyxirVendored.Project.dialyzer_ignore_warnings() cond do !ignore_warnings && File.exists?(default) -> @@ -356,14 +356,14 @@ defmodule Mix.Tasks.Dialyzer do info(""" COMPATIBILITY NOTICE ------------------------ - Previous usage of a pre-0.4 version of Dialyxir detected. Please be aware that the 0.4 release + Previous usage of a pre-0.4 version of DialyxirVendored detected. Please be aware that the 0.4 release makes a number of changes to previous defaults. Among other things, the PLT task is automatically run when dialyzer is run, PLT paths have changed, transitive dependencies are included by default in the PLT, and no additional warning flags beyond the dialyzer defaults are included. All these properties can be changed in configuration. (see `mix help dialyzer`). - If you no longer use the older Dialyxir in any projects and do not want to see this notice each time you upgrade your Erlang/Elixir distribution, you can delete your old pre-0.4 PLT files. (`rm ~/.dialyxir_core_*.plt`) + If you no longer use the older DialyxirVendored in any projects and do not want to see this notice each time you upgrade your Erlang/Elixir distribution, you can delete your old pre-0.4 PLT files. (`rm ~/.dialyxir_core_*.plt`) """) end end diff --git a/lib/mix/tasks/dialyzer/explain.ex b/lib/mix/tasks/dialyzer/explain.ex index 282099cf..46c0fc5c 100644 --- a/lib/mix/tasks/dialyzer/explain.ex +++ b/lib/mix/tasks/dialyzer/explain.ex @@ -1,4 +1,4 @@ -defmodule Mix.Tasks.Dialyzer.Explain do +defmodule Mix.Tasks.DialyzerVendored.Explain do @shortdoc "Display information about Dialyzer warnings." @moduledoc """ @@ -16,7 +16,7 @@ defmodule Mix.Tasks.Dialyzer.Explain do ``` """ use Mix.Task - alias Dialyxir.Output + alias DialyxirVendored.Output def run(args) do case OptionParser.parse(args, strict: []) do @@ -34,7 +34,7 @@ defmodule Mix.Tasks.Dialyzer.Explain do defp explanation_text(warning_name) do warning = String.to_atom(warning_name) - case Map.get(Dialyxir.Warnings.warnings(), warning) do + case Map.get(DialyxirVendored.Warnings.warnings(), warning) do nil -> "Unknown warning named: #{warning_name}" @@ -45,7 +45,7 @@ defmodule Mix.Tasks.Dialyzer.Explain do defp list_warnings do warnings = - Dialyxir.Warnings.warnings() + DialyxirVendored.Warnings.warnings() |> Map.keys() |> Enum.sort() |> Enum.map_join("\n", &Atom.to_string/1) diff --git a/mix.exs b/mix.exs index fd6f42e6..9e818ebd 100644 --- a/mix.exs +++ b/mix.exs @@ -1,4 +1,4 @@ -defmodule Dialyxir.Mixfile do +defmodule DialyxirVendored.Mixfile do use Mix.Project @source_url "https://github.com/jeremyjh/dialyxir" @@ -6,7 +6,7 @@ defmodule Dialyxir.Mixfile do def project do [ - app: :dialyxir, + app: :dialyxir_vendored, version: @version, elixir: ">= 1.6.0", elixirc_paths: elixirc_paths(Mix.env()), @@ -20,7 +20,7 @@ defmodule Dialyxir.Mixfile do flags: [:unmatched_returns, :error_handling, :underspecs] ], # Docs - name: "Dialyxir", + name: "DialyxirVendored", homepage_url: @source_url, # The main page in the docs docs: [ @@ -33,7 +33,7 @@ defmodule Dialyxir.Mixfile do end def application do - [mod: {Dialyxir, []}, extra_applications: [:dialyzer, :crypto, :mix]] + [mod: {DialyxirVendored, []}, extra_applications: [:dialyzer, :crypto, :mix]] end defp description do diff --git a/test/dialyxir/dialyzer_test.exs b/test/dialyxir/dialyzer_test.exs index bfc0a8c2..ff85e368 100644 --- a/test/dialyxir/dialyzer_test.exs +++ b/test/dialyxir/dialyzer_test.exs @@ -1,6 +1,6 @@ -defmodule Dialyxir.DialyzerTest do +defmodule DialyxirVendored.DialyzerTest do use ExUnit.Case - alias Dialyxir.Dialyzer + alias DialyxirVendored.Dialyzer defmodule StubSuccess do def run(_, _), do: {:ok, {"time", [], ""}} diff --git a/test/dialyxir/formatter_test.exs b/test/dialyxir/formatter_test.exs index e9e4f311..c04d1864 100644 --- a/test/dialyxir/formatter_test.exs +++ b/test/dialyxir/formatter_test.exs @@ -1,13 +1,13 @@ -defmodule Dialyxir.FormatterTest do +defmodule DialyxirVendored.FormatterTest do use ExUnit.Case import ExUnit.CaptureIO, only: [capture_io: 1] - alias Dialyxir.Formatter - alias Dialyxir.Formatter.Dialyxir, as: DialyxirFormatter - alias Dialyxir.Formatter.Dialyzer, as: DialyzerFormatter - alias Dialyxir.Formatter.Short, as: ShortFormatter - alias Dialyxir.Project + alias DialyxirVendored.Formatter + alias DialyxirVendored.Formatter.DialyxirVendored, as: DialyxirVendoredFormatter + alias DialyxirVendored.Formatter.Dialyzer, as: DialyzerFormatter + alias DialyxirVendored.Formatter.Short, as: ShortFormatter + alias DialyxirVendored.Project defp in_project(app, f) when is_atom(app) do Mix.Project.in_project(app, "test/fixtures/#{Atom.to_string(app)}", fn _ -> f.() end) @@ -132,7 +132,7 @@ defmodule Dialyxir.FormatterTest do filter_args = [{:list_unused_filters, true}] - for format <- [ShortFormatter, DialyxirFormatter, DialyzerFormatter] do + for format <- [ShortFormatter, DialyxirVendoredFormatter, DialyzerFormatter] do in_project(:ignore, fn -> capture_io(fn -> result = Formatter.format_and_filter(warnings, Project, filter_args, format) diff --git a/test/dialyxir/output_test.exs b/test/dialyxir/output_test.exs index c1d30eaa..63b41db6 100644 --- a/test/dialyxir/output_test.exs +++ b/test/dialyxir/output_test.exs @@ -1,6 +1,6 @@ -defmodule Dialyxir.OutputTest do +defmodule DialyxirVendored.OutputTest do use ExUnit.Case - alias Dialyxir.Output + alias DialyxirVendored.Output setup do ansi_enabled = IO.ANSI.enabled?() diff --git a/test/dialyxir/plt_test.exs b/test/dialyxir/plt_test.exs index 4cf8f354..54285c70 100644 --- a/test/dialyxir/plt_test.exs +++ b/test/dialyxir/plt_test.exs @@ -1,5 +1,5 @@ -defmodule Dialyxir.PltTest do - alias Dialyxir.Plt +defmodule DialyxirVendored.PltTest do + alias DialyxirVendored.Plt import ExUnit.CaptureIO, only: [capture_io: 1] use ExUnit.Case @@ -17,7 +17,7 @@ defmodule Dialyxir.PltTest do end assert capture_io(fun) == - "==> dialyxir\n" <> + "==> dialyxir_vendored\n" <> "Looking up modules in dialyxir_erlang-20.3.plt\n" <> "Looking up modules in dialyxir_erlang-20.3_elixir-1.6.2_deps-dev.plt\n" <> "/var/dialyxir_erlang-20.3_elixir-1.6.2_deps-dev.plt\n" <> diff --git a/test/dialyxir/project_test.exs b/test/dialyxir/project_test.exs index 03171b57..f24a8945 100644 --- a/test/dialyxir/project_test.exs +++ b/test/dialyxir/project_test.exs @@ -1,5 +1,5 @@ -defmodule Dialyxir.ProjectTest do - alias Dialyxir.Project +defmodule DialyxirVendored.ProjectTest do + alias DialyxirVendored.Project use ExUnit.Case import ExUnit.CaptureIO, only: [capture_io: 1, capture_io: 2] diff --git a/test/examples/apply.ex b/test/examples/apply.ex index b0d44879..fe7a86bc 100644 --- a/test/examples/apply.ex +++ b/test/examples/apply.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Examples.Apply do +defmodule DialyxirVendored.Examples.Apply do def ok() do fun = fn :ok -> :ok end fun.(:error) diff --git a/test/examples/call.ex b/test/examples/call.ex index 2d68ccad..3588da3b 100644 --- a/test/examples/call.ex +++ b/test/examples/call.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Examples.Call do +defmodule DialyxirVendored.Examples.Call do def ok() do ok(:error) end diff --git a/test/examples/callback_argument.ex b/test/examples/callback_argument.ex index 5518bc92..0d48f341 100644 --- a/test/examples/callback_argument.ex +++ b/test/examples/callback_argument.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Examples.CallbackArgument do +defmodule DialyxirVendored.Examples.CallbackArgument do defmodule Behaviour do @callback ok(:ok) :: :ok end diff --git a/test/examples/callback_spec_argument.ex b/test/examples/callback_spec_argument.ex index 7eaa920e..e7b9899a 100644 --- a/test/examples/callback_spec_argument.ex +++ b/test/examples/callback_spec_argument.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Examples.CallbackSpecArgument do +defmodule DialyxirVendored.Examples.CallbackSpecArgument do defmodule Behaviour do @callback ok(:ok) :: :ok end diff --git a/test/examples/contract_supertype.ex b/test/examples/contract_supertype.ex index ff7ca46a..f9531e4d 100644 --- a/test/examples/contract_supertype.ex +++ b/test/examples/contract_supertype.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Examples.ContractSuperType do +defmodule DialyxirVendored.Examples.ContractSuperType do @spec ok() :: any def ok() do :ok diff --git a/test/examples/contract_with_opaque.ex b/test/examples/contract_with_opaque.ex index fd25936c..aec60982 100644 --- a/test/examples/contract_with_opaque.ex +++ b/test/examples/contract_with_opaque.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Examples.ContractWithOpaque do +defmodule DialyxirVendored.Examples.ContractWithOpaque do defmodule Types do @opaque type :: :ok end diff --git a/test/examples/exact_equality.ex b/test/examples/exact_equality.ex index d903f4ca..a36b27c8 100644 --- a/test/examples/exact_equality.ex +++ b/test/examples/exact_equality.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Examples.ExactEquality do +defmodule DialyxirVendored.Examples.ExactEquality do def ok() do :ok == :error end diff --git a/test/examples/extra-range.ex b/test/examples/extra-range.ex index f9c40f7f..08fbab8f 100644 --- a/test/examples/extra-range.ex +++ b/test/examples/extra-range.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Examples.ExtraRange do +defmodule DialyxirVendored.Examples.ExtraRange do @spec ok() :: :ok | :error def ok() do :ok diff --git a/test/examples/function_app_args.ex b/test/examples/function_app_args.ex index 507b636e..6fcb9e37 100644 --- a/test/examples/function_app_args.ex +++ b/test/examples/function_app_args.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Examples.FunctionApplicationArgs do +defmodule DialyxirVendored.Examples.FunctionApplicationArgs do def f do fn :a, [] -> :ok end end diff --git a/test/examples/function_app_no_fun.ex b/test/examples/function_app_no_fun.ex index b6e07a4f..c8f99ae3 100644 --- a/test/examples/function_app_no_fun.ex +++ b/test/examples/function_app_no_fun.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Examples.FunctionApplicationNoFun do +defmodule DialyxirVendored.Examples.FunctionApplicationNoFun do def ok() do fun = fn _ -> :ok end fun.() diff --git a/test/examples/guard_fail.ex b/test/examples/guard_fail.ex index af05bb44..6ee2f3ae 100644 --- a/test/examples/guard_fail.ex +++ b/test/examples/guard_fail.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Examples.GuardFail do +defmodule DialyxirVendored.Examples.GuardFail do def ok() do ok(0) end diff --git a/test/examples/guard_fail_pattern.ex b/test/examples/guard_fail_pattern.ex index 73785e82..f4daadf2 100644 --- a/test/examples/guard_fail_pattern.ex +++ b/test/examples/guard_fail_pattern.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Examples.GuardFailPattern do +defmodule DialyxirVendored.Examples.GuardFailPattern do def ok(n = 0) when not n < 1 do :ok end diff --git a/test/examples/opaque_equality.ex b/test/examples/opaque_equality.ex index bf5aa29d..c1996949 100644 --- a/test/examples/opaque_equality.ex +++ b/test/examples/opaque_equality.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Examples.OpaqueEquality do +defmodule DialyxirVendored.Examples.OpaqueEquality do defmodule Types do @opaque type :: :ok diff --git a/test/examples/opaque_match.ex b/test/examples/opaque_match.ex index 96c62e3d..96de912f 100644 --- a/test/examples/opaque_match.ex +++ b/test/examples/opaque_match.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Examples.OpaqueMatch do +defmodule DialyxirVendored.Examples.OpaqueMatch do defmodule Struct do defstruct [:opaque] diff --git a/test/examples/pattern_match.ex b/test/examples/pattern_match.ex index 69ca6acb..368bbecc 100644 --- a/test/examples/pattern_match.ex +++ b/test/examples/pattern_match.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Examples.PatternMatch do +defmodule DialyxirVendored.Examples.PatternMatch do def ok() do unmatched(:ok) end diff --git a/test/examples/pattern_match_covered.ex b/test/examples/pattern_match_covered.ex index 69f623fd..5cda2044 100644 --- a/test/examples/pattern_match_covered.ex +++ b/test/examples/pattern_match_covered.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Examples.PatternMuchCovered do +defmodule DialyxirVendored.Examples.PatternMuchCovered do def ok() do unmatched(:error) end diff --git a/test/examples/unknown_type.ex b/test/examples/unknown_type.ex index 091560c4..9b5cd885 100644 --- a/test/examples/unknown_type.ex +++ b/test/examples/unknown_type.ex @@ -1,4 +1,4 @@ -defmodule Dialyxir.Examples.UnknownType do +defmodule DialyxirVendored.Examples.UnknownType do defmodule Missing do end diff --git a/test/mix/tasks/dialyzer_test.exs b/test/mix/tasks/dialyzer_test.exs index 772d6530..410a958d 100644 --- a/test/mix/tasks/dialyzer_test.exs +++ b/test/mix/tasks/dialyzer_test.exs @@ -1,4 +1,4 @@ -defmodule Mix.Tasks.DialyzerTest do +defmodule Mix.Tasks.DialyzerVendoredTest do use ExUnit.Case import ExUnit.CaptureIO, only: [capture_io: 1] @@ -11,7 +11,7 @@ defmodule Mix.Tasks.DialyzerTest do test "Delete PLT file name" do in_project(:local_plt, fn -> - fun = fn -> Mix.Tasks.Dialyzer.clean([], &no_delete_plt/4) end + fun = fn -> Mix.Tasks.DialyzerVendored.clean([], &no_delete_plt/4) end assert Regex.match?( ~r/About to delete PLT file: .*\/test\/fixtures\/local_plt\/local.plt/, @@ -22,7 +22,7 @@ defmodule Mix.Tasks.DialyzerTest do test "Core PLTs are not deleted without --all flag" do in_project(:local_plt, fn -> - fun = fn -> Mix.Tasks.Dialyzer.clean([], &no_delete_plt/4) end + fun = fn -> Mix.Tasks.DialyzerVendored.clean([], &no_delete_plt/4) end assert not Regex.match?( ~r/About to delete PLT file: .*dialyxir_erlang/, @@ -33,7 +33,7 @@ defmodule Mix.Tasks.DialyzerTest do test "Core PLTs are deleted with --all flag" do in_project(:local_plt, fn -> - fun = fn -> Mix.Tasks.Dialyzer.clean([{:all, true}], &no_delete_plt/4) end + fun = fn -> Mix.Tasks.DialyzerVendored.clean([{:all, true}], &no_delete_plt/4) end assert Regex.match?( ~r/About to delete PLT file: .*dialyxir_erlang/, diff --git a/test/warning_test.exs b/test/warning_test.exs index d958cb7b..427d7eec 100644 --- a/test/warning_test.exs +++ b/test/warning_test.exs @@ -1,10 +1,10 @@ -defmodule Dialyxir.Test.WarningTest do +defmodule DialyxirVendored.Test.WarningTest do use ExUnit.Case # Don't test output in here, just that it can succeed. test "pattern match warning succeeds on valid input" do arguments = ['pattern {\'ok\', Vuser@1}', '{\'error\',<<_:64,_:_*8>>}'] - assert(Dialyxir.Warnings.PatternMatch.format_long(arguments)) + assert(DialyxirVendored.Warnings.PatternMatch.format_long(arguments)) end end