From b408c229c71b50fd39aca17d3cdcdb50c4e40db8 Mon Sep 17 00:00:00 2001 From: Tomasz Marek Sulima Date: Mon, 4 Nov 2024 13:58:57 +0200 Subject: [PATCH 1/2] fix missing parentheses warning in `Credo.Check.Params.category/2` ``` warning: using map.field notation (without parentheses) to invoke function Credo.Check.Refactor.ModuleDependencies.category() is deprecated, you must add parentheses instead: remote.function() (credo 1.7.9) lib/credo/check/params.ex:74: Credo.Check.Params.category/2 (credo 1.7.9) lib/credo/check.ex:697: Credo.Check.format_issue/3 (credo 1.7.9) lib/credo/check/refactor/module_dependencies.ex:111: Credo.Check.Refactor.ModuleDependencies.issues_for_module/5 (credo 1.7.9) lib/credo/check/refactor/module_dependencies.ex:89: Credo.Check.Refactor.ModuleDependencies.traverse/6 (elixir 1.17.3) lib/macro.ex:599: Macro.traverse/4 ``` --- lib/credo/check/params.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/credo/check/params.ex b/lib/credo/check/params.ex index 9ae06b687..08ca4fa4f 100644 --- a/lib/credo/check/params.ex +++ b/lib/credo/check/params.ex @@ -71,7 +71,7 @@ defmodule Credo.Check.Params do @doc false def category(params, check_mod) do - params[:__category__] || params[:category] || check_mod.category + params[:__category__] || params[:category] || check_mod.category() end @doc false From 0f02b02e059b9b8ae7cb809f27ba5c208f17d9a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20F=C3=B6hring?= Date: Mon, 4 Nov 2024 20:28:45 +0100 Subject: [PATCH 2/2] Add missing parens to function call --- lib/credo/cli/command/help.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/credo/cli/command/help.ex b/lib/credo/cli/command/help.ex index b310f6349..50d5860c8 100644 --- a/lib/credo/cli/command/help.ex +++ b/lib/credo/cli/command/help.ex @@ -50,7 +50,7 @@ defmodule Credo.CLI.Command.Help do |> to_string |> String.pad_trailing(@ljust) - case module.short_description do + case module.short_description() do nil -> UI.puts(" #{padded_name}")