View Source Credo.CLI.Output (Credo v1.6.4)
This module provides helper functions regarding command line output.
Link to this section Summary
Functions
Returns a suitable foreground color for a given background_color
.
Returns a suitable color for a given priority.
Returns a suitable arrow for a given priority.
Returns a suitable name for a given priority.
Link to this section Functions
Returns a suitable foreground color for a given background_color
.
iex> Credo.CLI.Output.foreground_color(:yellow)
:black
iex> Credo.CLI.Output.foreground_color(:blue)
:white
Returns a suitable color for a given priority.
iex> Credo.CLI.Output.issue_color(%Credo.Issue{priority: :higher})
:red
iex> Credo.CLI.Output.issue_color(%Credo.Issue{priority: 20})
:red
Returns a suitable arrow for a given priority.
iex> Credo.CLI.Output.priority_arrow(:high)
"↗"
iex> Credo.CLI.Output.priority_arrow(10)
"↗"
iex> Credo.CLI.Output.priority_arrow(%Credo.Issue{priority: 10})
"↗"
Returns a suitable name for a given priority.
iex> Credo.CLI.Output.priority_name(:normal)
"normal"
iex> Credo.CLI.Output.priority_name(1)
"normal"
iex> Credo.CLI.Output.priority_name(%Credo.Issue{priority: 1})
"normal"