Skip to content

Commit 6c0c3e5

Browse files
committed
Tentatively finish this round of CI whack-a-mole
1 parent ff4be1e commit 6c0c3e5

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

lib/sqids/hacks.ex

+3-9
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ defmodule Sqids.Hacks do
22
@moduledoc "Workarounds"
33
@moduledoc since: "0.1.2"
44

5-
require Logger
6-
75
@doc """
86
Function to work around Dialyzer warnings on violating
97
type opacity when Sqids context is placed in a module attribute, since it
@@ -19,7 +17,9 @@ defmodule Sqids.Hacks do
1917
using_mod_str = inspect(using_mod)
2018

2119
if missed_opts === [] do
22-
log_warning("""
20+
# Use Erlang's logger cause Logger.warning() wasn't available before
21+
# Elixir 1.11 and Styler replaces Logger.warn() with Logger.warning()...
22+
:logger.warning("""
2323
Direct call of #{using_mod_str}.child_spec/1 may lead to unintended results in the future.
2424
2525
Update #{using_mod_str}'s entry under your supervisor,
@@ -70,10 +70,4 @@ defmodule Sqids.Hacks do
7070
"""
7171
end
7272
end
73-
74-
if Version.match?(System.version(), "~> 1.11") do
75-
def log_warning(msg), do: Logger.warning(msg)
76-
else
77-
def log_warning(msg), do: Logger.warning(msg)
78-
end
7973
end

mix.exs

+1-8
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@ defmodule Sqids.MixProject do
1717
elixirc_paths: elixirc_paths(mix_env),
1818
elixirc_options: elixirc_options(mix_env),
1919
docs: docs(),
20-
extra_applications: [:logger],
2120
test_coverage: [
2221
summary: [
2322
threshold: 93
2423
]
2524
],
26-
dialyzer: [plt_add_apps: [:ex_unit, :logger]],
25+
dialyzer: [plt_add_apps: [:ex_unit]],
2726
package: package()
2827
]
2928
end
@@ -32,12 +31,6 @@ defmodule Sqids.MixProject do
3231
"Generate YouTube-looking IDs from numbers"
3332
end
3433

35-
def application do
36-
[
37-
extra_applications: [:logger]
38-
]
39-
end
40-
4134
defp deps do
4235
List.flatten([
4336
{:ex_doc, "~> 0.30", only: :dev, runtime: false},

0 commit comments

Comments
 (0)