Skip to content

Commit

Permalink
refactor: use inspect
Browse files Browse the repository at this point in the history
  • Loading branch information
woylie authored and rrrene committed Jan 15, 2022
1 parent d953d64 commit c52b985
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/credo/cli/output/formatter/json.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ defmodule Credo.CLI.Output.Formatter.JSON do
def prepare_for_json([]), do: []
def prepare_for_json([h | t]), do: [prepare_for_json(h) | prepare_for_json(t)]

def prepare_for_json(%Regex{} = regex), do: "~r/#{Regex.source(regex)}/"
def prepare_for_json(%Regex{} = regex), do: inspect(regex)

def prepare_for_json(%{} = term) do
Enum.into(term, %{}, fn {key, value} ->
Expand Down

0 comments on commit c52b985

Please sign in to comment.