Skip to content

Commit

Permalink
Remove unused param from MissedMetadataKeyInLoggerConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
rrrene committed Feb 6, 2024
1 parent 390573c commit e766b41
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lib/credo/check/warning/missed_metadata_key_in_logger_config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ defmodule Credo.Check.Warning.MissedMetadataKeyInLoggerConfig do
metadata config.
""",
params: [
ignore_logger_functions: "Do not raise an issue for these Logger functions.",
metadata_keys: """
Do not raise an issue for these Logger metadata keys.
Expand Down Expand Up @@ -160,12 +159,6 @@ defmodule Credo.Check.Warning.MissedMetadataKeyInLoggerConfig do
defp logger_import?([{:__aliases__, _meta, [:Logger]}]), do: true
defp logger_import?(_), do: false

defp issue_for(issue_meta, line_no, [trigger | _] = missed_keys) do
message = "Logger metadata key #{Enum.join(missed_keys, ", ")} not found in Logger config"

format_issue(issue_meta, message: message, line_no: line_no, trigger: trigger)
end

defp find_metadata_keys(params) do
metadata_keys = Params.get(params, :metadata_keys, __MODULE__)

Expand All @@ -182,4 +175,12 @@ defmodule Credo.Check.Warning.MissedMetadataKeyInLoggerConfig do
|> Application.get_env(key, [])
|> Keyword.get(:metadata)
end

defp issue_for(issue_meta, line_no, [trigger | _] = missed_keys) do
format_issue(issue_meta,
message: "Logger metadata key #{Enum.join(missed_keys, ", ")} not found in Logger config",
line_no: line_no,
trigger: trigger
)
end
end

0 comments on commit e766b41

Please sign in to comment.