rrrene / credo

A static code analysis tool for the Elixir language with a focus on code consistency and teaching.
http://credo-ci.org/
MIT License
4.94k stars 419 forks source link

False positive in `Credo.Check.Refactor.Apply` #1151

Closed albertored closed 2 months ago

albertored commented 2 months ago

Environment

With the following snippet of code I get a Credo.Check.Refactor.Apply warning in functuion foo2 (wrong) while no warning for function foo1 (correct).

defmodule A do
  def foo1(args) do
    apply(Bar, :baz, [1 | args])
  end

  def foo2(args) do
    apply(Bar, :baz, [1, 2 | args])
  end
end
rrrene commented 1 month ago

@albertored This is part of Credo 1.7.8. Thx! 🎉