Skip to content

Commit

Permalink
Fix warnings for Elixir 1.18
Browse files Browse the repository at this point in the history
  • Loading branch information
rrrene committed Dec 13, 2024
1 parent 2e15cdd commit d0db408
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
erlang 27.0
elixir 1.17.3
elixir 1.18.0-rc.0
7 changes: 3 additions & 4 deletions lib/credo/cli/command/categories/categories_output.ex
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
defmodule Credo.CLI.Command.Categories.CategoriesOutput do
@moduledoc false

use Credo.CLI.Output.FormatDelegator,
default: Credo.CLI.Command.Categories.Output.Default,
json: Credo.CLI.Command.Categories.Output.Json

def print_categories(exec, categories) do
format_mod = format_mod(exec)

format_mod.print(exec, categories)
end

defp format_mod(%{format: "json"}), do: Credo.CLI.Command.Categories.Output.Json
defp format_mod(%{format: nil}), do: Credo.CLI.Command.Categories.Output.Default
end
7 changes: 3 additions & 4 deletions lib/credo/cli/command/info/info_output.ex
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
defmodule Credo.CLI.Command.Info.InfoOutput do
@moduledoc false

use Credo.CLI.Output.FormatDelegator,
default: Credo.CLI.Command.Info.Output.Default,
json: Credo.CLI.Command.Info.Output.Json

alias Credo.CLI.Output.UI

def print(exec, info) do
Expand All @@ -13,6 +9,9 @@ defmodule Credo.CLI.Command.Info.InfoOutput do
format_mod.print(exec, info)
end

defp format_mod(%{format: "json"}), do: Credo.CLI.Command.Info.Output.Json
defp format_mod(%{format: nil}), do: Credo.CLI.Command.Info.Output.Default

def print_help(exec) do
usage = ["Usage: ", :olive, "mix credo info [options]"]

Expand Down

0 comments on commit d0db408

Please sign in to comment.