Skip to content

Commit

Permalink
Tentatively finish this round of CI whack-a-mole
Browse files Browse the repository at this point in the history
  • Loading branch information
g-andrade committed Oct 12, 2024
1 parent ff4be1e commit 6c0c3e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
12 changes: 3 additions & 9 deletions lib/sqids/hacks.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ defmodule Sqids.Hacks do
@moduledoc "Workarounds"
@moduledoc since: "0.1.2"

require Logger

@doc """
Function to work around Dialyzer warnings on violating
type opacity when Sqids context is placed in a module attribute, since it
Expand All @@ -19,7 +17,9 @@ defmodule Sqids.Hacks do
using_mod_str = inspect(using_mod)

if missed_opts === [] do
log_warning("""
# Use Erlang's logger cause Logger.warning() wasn't available before
# Elixir 1.11 and Styler replaces Logger.warn() with Logger.warning()...
:logger.warning("""
Direct call of #{using_mod_str}.child_spec/1 may lead to unintended results in the future.
Update #{using_mod_str}'s entry under your supervisor,
Expand Down Expand Up @@ -70,10 +70,4 @@ defmodule Sqids.Hacks do
"""
end
end

if Version.match?(System.version(), "~> 1.11") do
def log_warning(msg), do: Logger.warning(msg)
else
def log_warning(msg), do: Logger.warning(msg)
end
end
9 changes: 1 addition & 8 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ defmodule Sqids.MixProject do
elixirc_paths: elixirc_paths(mix_env),
elixirc_options: elixirc_options(mix_env),
docs: docs(),
extra_applications: [:logger],
test_coverage: [
summary: [
threshold: 93
]
],
dialyzer: [plt_add_apps: [:ex_unit, :logger]],
dialyzer: [plt_add_apps: [:ex_unit]],
package: package()
]
end
Expand All @@ -32,12 +31,6 @@ defmodule Sqids.MixProject do
"Generate YouTube-looking IDs from numbers"
end

def application do
[
extra_applications: [:logger]
]
end

defp deps do
List.flatten([
{:ex_doc, "~> 0.30", only: :dev, runtime: false},
Expand Down

0 comments on commit 6c0c3e5

Please sign in to comment.