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

Readability.NestedFunctionCalls triggered on function calls in interpolated strings #1034

Closed
dustinfarris opened this issue Mar 21, 2023 · 3 comments

Comments

@dustinfarris
Copy link

dustinfarris commented Mar 21, 2023

Environment

  • Credo version (mix credo -v): 1.7.0-ref.upgrade-tools.7f37f20c+uncommittedchanges
  • Erlang/Elixir version (elixir -v): Erlang/OTP 25 [erts-13.2] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns] Elixir 1.14.3 (compiled with Erlang/OTP 25)
  • Operating system: MacOS Ventura

Not sure if this is intended or not, but credo 1.7.0 starts triggering the NestedFunctionCalls check for things like this:

case do_something() do
  {:error, error} -> Logger.error("There was an error: #{inspect(error)}")

It seems to want inspect(error) pulled out into its own line e.g.

inspected_error = inspect(error)
Logger.error("There was an error: #{inspected_error}")

Is this the intended direction for readability?

@rrrene
Copy link
Owner

rrrene commented Dec 17, 2023

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 Dec 18, 2023

This is part of 1.7.2-rc.3 👍

@rrrene
Copy link
Owner

rrrene commented Dec 29, 2023

This is part of Credo 1.7.2. 👍

@rrrene rrrene closed this as completed Dec 29, 2023
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