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

False positive on "There should be no unused return values for Enum functions" with anonymous function usage #1167

Open
byronanderson opened this issue Dec 12, 2024 · 1 comment

Comments

@byronanderson
Copy link

Environment

  • Credo version (mix credo -v): 1.7.10-ref.main.35db3d57b+uncommittedchanges
  • Erlang/Elixir version (elixir -v):
    • Erlang/OTP 27 [erts-15.1.2] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit]
    • Elixir 1.17.3 (compiled with Erlang/OTP 27)
  • Operating system: Mac OS Sonoma 14.7.2

What were you trying to do?

Run mix credowith the following code:

anon_func.(Enum.random(1..10))

Expected outcome

Tell me my code is ok because Enum.random(1..10) is used inside the anonymous function call

Actual outcome

Error message produced:

There should be no unused return values for Enum functions

rrrene added a commit that referenced this issue Dec 13, 2024
@rrrene
Copy link
Owner

rrrene commented Dec 13, 2024

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! 👍

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

No branches or pull requests

2 participants