Skip to content

Commit

Permalink
Fix Elixir 1.16 warnings
Browse files Browse the repository at this point in the history
- Fixes `Logger.warn` deprecation (requires bump to Elixir 1.11 which
  was released on 2020-10-06)
- ssl_verify_fun 1.1.6 doesn't compile under Elixir 1.16
- Remove `applications` definition and instead only use extra_applications
  - Fixes this warning "both :extra_applications and :applications was found in your mix.exs. You most likely want to remove the :applications key, as all applications are derived from your dependencies"
  - Also the applications listed in `apps` were just the normal
    dependencies (and logger)
  • Loading branch information
axelson committed Jan 25, 2024
1 parent bb129f8 commit 7165ec9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
4 changes: 2 additions & 2 deletions lib/stripe/converter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ defmodule Stripe.Converter do
defp warn_unknown_object(%{"object" => object_name}) do
require Logger

Logger.warn("Unknown object received: #{object_name}")
Logger.warning("Unknown object received: #{object_name}")
end
end

Expand Down Expand Up @@ -103,7 +103,7 @@ defmodule Stripe.Converter do

details = "#{module_name}: #{inspect(extra_keys)}"
message = "Extra keys were received but ignored when converting #{details}"
Logger.warn(message)
Logger.warning(message)
end

:ok
Expand Down
2 changes: 1 addition & 1 deletion lib/stripe/util.ex
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ defmodule Stripe.Util do

quote bind_quoted: [mod: mod, fun: fun, arity: arity, msg: msg] do
require Logger
Logger.warn("[DEPRECATION] The function #{mod}.#{fun}/#{arity} is deprecated. #{msg}")
Logger.warning("[DEPRECATION] The function #{mod}.#{fun}/#{arity} is deprecated. #{msg}")
end
end
end
Expand Down
9 changes: 2 additions & 7 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule Stripe.Mixfile do
[
app: :stripity_stripe,
version: @version,
elixir: "~> 1.10",
elixir: "~> 1.11",
deps: deps(),
docs: docs(),
package: package(),
Expand All @@ -30,8 +30,7 @@ defmodule Stripe.Mixfile do
# Configuration for the OTP application
def application do
[
applications: apps(Mix.env()),
extra_applications: [:plug],
extra_applications: [:logger],
env: env(),
mod: {Stripe, []}
]
Expand All @@ -53,10 +52,6 @@ defmodule Stripe.Mixfile do
]
end

defp apps(:test), do: apps()
defp apps(_), do: apps()
defp apps, do: [:hackney, :logger, :jason, :uri_query]

defp deps do
[
{:dialyxir, "1.1.0", only: [:dev, :test], runtime: false},
Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"},
"plug": {:hex, :plug, "1.14.0", "ba4f558468f69cbd9f6b356d25443d0b796fbdc887e03fa89001384a9cac638f", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "bf020432c7d4feb7b3af16a0c2701455cbbbb95e5b6866132cb09eb0c29adc14"},
"plug_crypto": {:hex, :plug_crypto, "1.2.3", "8f77d13aeb32bfd9e654cb68f0af517b371fb34c56c9f2b58fe3df1235c1251a", [:mix], [], "hexpm", "b5672099c6ad5c202c45f5a403f21a3411247f164e4a8fab056e5cd8a290f4a2"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"},
"telemetry": {:hex, :telemetry, "1.1.0", "a589817034a27eab11144ad24d5c0f9fab1f58173274b1e9bae7074af9cbee51", [:rebar3], [], "hexpm", "b727b2a1f75614774cff2d7565b64d0dfa5bd52ba517f16543e6fc7efcc0df48"},
"unicode_util_compat": {:hex, :unicode_util_compat, "0.7.0", "bc84380c9ab48177092f43ac89e4dfa2c6d62b40b8bd132b1059ecc7232f9a78", [:rebar3], [], "hexpm", "25eee6d67df61960cf6a794239566599b09e17e668d3700247bc498638152521"},
"uri_query": {:hex, :uri_query, "0.1.2", "ae35b83b472f3568c2c159eee3f3ccf585375d8a94fb5382db1ea3589e75c3b4", [:mix], [], "hexpm", "e3bc81816c98502c36498b9b2f239b89c71ce5eadfff7ceb2d6c0a2e6ae2ea0c"},
Expand Down

0 comments on commit 7165ec9

Please sign in to comment.