Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Predicate function names check does not work for non-zero arity functions #866

Closed
laurglia opened this issue Mar 29, 2021 · 3 comments
Closed

Comments

@laurglia
Copy link

laurglia commented Mar 29, 2021

Precheck

Environment

  • Credo version (mix credo -v): 1.5.4
  • Erlang/Elixir version (elixir -v): Erlang 23, Elixir 1.11.3
  • Operating system: Mac OS

What were you trying to do?

  1. Have following function definition
defmodule A do
  defp is_user(cookie) do
    true
  end
end
  1. Credo has PredicateFunctionNames check enabled.
  2. Run credo

Expected outcome

Credo reports an issue with the function - it is a predicate function that starts with is_.

Actual outcome

Credo does not report any issues.

Extra information

The check works fine if I make the function 0-arity, for the following code an issue is reported:

defmodule A do
  defp is_user do
    true
  end
end
panoramix360 added a commit to panoramix360/credo that referenced this issue Mar 31, 2021
@panoramix360
Copy link
Contributor

I created a pull request fixing this issue, just waiting for approval :)

@rrrene
Copy link
Owner

rrrene commented May 17, 2021

Thanks for reporting this 😀 It is now fixed on master.

You can try this by setting the Credo dep to

{:credo, github: "rrrene/credo"}

Please report back if your issue is solved! 👍

@rrrene
Copy link
Owner

rrrene commented Nov 19, 2021

This is part of v1.6.1 💚

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants