Permalink
Browse files

Add :number to default excluded_argument_types for PipeChainStart

  • Loading branch information...
rrrene committed Nov 20, 2018
1 parent 172ceec commit 2c4ef8362260c5996c444a40d4d6427b097f12eb
Showing with 12 additions and 1 deletion.
  1. +4 −1 .credo.exs
  2. +8 −0 test/credo/check/refactor/pipe_chain_start_test.exs
@@ -108,7 +108,10 @@
{Credo.Check.Refactor.NegatedConditionsWithElse, []},
{Credo.Check.Refactor.Nesting, []},
{Credo.Check.Refactor.PipeChainStart,
[excluded_argument_types: [:atom, :binary, :fn, :keyword], excluded_functions: []]},
[
excluded_argument_types: [:atom, :binary, :fn, :keyword, :number],
excluded_functions: []
]},
{Credo.Check.Refactor.UnlessWithElse, []},

#
@@ -304,6 +304,14 @@ defmodule Credo.Check.Refactor.PipeChainStartTest do
|> refute_issues(@described_check, excluded_argument_types: [:fn])
end

test "it should NOT report a violation for an excluded argument type /6" do
"""
max(0, interval - elapsed_time) |> schedule_events()
"""
|> to_source_file
|> refute_issues(@described_check, excluded_argument_types: [:number])
end

#
# cases raising issues
#

0 comments on commit 2c4ef83

Please sign in to comment.