Skip to content

Commit

Permalink
Merge pull request #604 from rentpath/feature/fix_readability_issues
Browse files Browse the repository at this point in the history
Fix a few more issues shown by mix credo
  • Loading branch information
rrrene committed Dec 28, 2018
2 parents cb1d8cf + 435e793 commit 7251a79
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
1 change: 1 addition & 0 deletions lib/credo/code/token.ex
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ defmodule Credo.Code.Token do
end
end

# credo:disable-for-next-line Credo.Check.Readability.ModuleNames
defmodule ElixirPre1_6_0 do
@moduledoc false

Expand Down
3 changes: 1 addition & 2 deletions lib/credo/execution/execution_timing.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ defmodule Credo.Execution.ExecutionTiming do
def inspect(label, fun) do
{time, result} = :timer.tc(fun)

# credo:disable-for-lines:3 Credo.Check.Warning.IoInspect
time
|> format_time()
|> IO.inspect(label: label)

# credo:disable-for-previous-line Credo.Check.Warning.IoInspect

result
end

Expand Down
10 changes: 4 additions & 6 deletions lib/credo/execution/task/convert_cli_options_to_config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,7 @@ defmodule Credo.Execution.Task.ConvertCLIOptionsToConfig do
UI.warn("")

Enum.each(lines, fn {line_no2, line} ->
color =
if line_no2 == line_no do
[:bright, :cyan]
else
[:faint]
end
color = color_list(line_no, line_no2)

UI.warn([color, String.pad_leading("#{line_no2}", 5), :reset, " ", color, line])
end)
Expand All @@ -64,4 +59,7 @@ defmodule Credo.Execution.Task.ConvertCLIOptionsToConfig do

exec
end

defp color_list(line_no, line_no2) when line_no == line_no2, do: [:bright, :cyan]
defp color_list(_, _), do: [:faint]
end

0 comments on commit 7251a79

Please sign in to comment.