File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -235,12 +235,7 @@ defmodule JSONFormatter do
235235
236236 # Colorize Utility Functions -- from ExUnit.CLIFormatter, but can't import d/t being private in source
237237
238- defp colorize ( escape , msg , config ) when is_doc ( msg ) do
239- msg = Inspect.Algebra . format ( msg , 2 )
240- colorize ( escape , msg , config )
241- end
242-
243- defp colorize ( escape , string , % { colors: colors } ) do
238+ defp colorize ( escape , string , % { colors: colors } ) when is_binary ( string ) do
244239 if colors [ :enabled ] do
245240 [ escape , string , :reset ]
246241 |> IO.ANSI . format_fragment ( true )
@@ -250,6 +245,15 @@ defmodule JSONFormatter do
250245 end
251246 end
252247
248+ defp colorize ( escape , msg , config ) when is_doc ( msg ) do
249+ msg =
250+ msg
251+ |> Inspect.Algebra . format ( 2 )
252+ |> IO . iodata_to_binary ( )
253+
254+ colorize ( escape , msg , config )
255+ end
256+
253257 @ doc """
254258 Helper function to get the full path of the generated report file.
255259 It can be passed 2 configurations via environment variable
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ defmodule Meta.Style do
22 def format ( ast ) do
33 ast
44 |> Macro . to_string ( )
5- |> Code . format_string! ( [ line_length: 120 , force_do_end_blocks: true ] )
5+ |> Code . format_string! ( line_length: 120 , force_do_end_blocks: true )
66 |> IO . iodata_to_binary ( )
77 end
88end
You can’t perform that action at this time.
0 commit comments