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

Credo throws an error when run over Phoenix #60

Closed
mikesive opened this issue Apr 5, 2016 · 4 comments
Closed

Credo throws an error when run over Phoenix #60

mikesive opened this issue Apr 5, 2016 · 4 comments
Assignees

Comments

@mikesive
Copy link

mikesive commented Apr 5, 2016

I cloned the Phoenix repo to test out credo. After executing

mix credo --all  --format=oneline

I got the following error:

** (EXIT from #PID<0.47.0>) an exception was raised:
    ** (Protocol.UndefinedError) protocol Enumerable not implemented for nil
        (elixir) lib/enum.ex:1: Enumerable.impl_for!/1
        (elixir) lib/enum.ex:116: Enumerable.reduce/3
        (elixir) lib/enum.ex:679: Enum.fetch/2
        (elixir) lib/enum.ex:311: Enum.at/3
        lib/credo/check/readability/function_names.ex:43: Credo.Check.Readability.FunctionNames.issues_for_definition/3
        lib/credo/check/readability/function_names.ex:35: Credo.Check.Readability.FunctionNames.traverse/3
        (elixir) lib/macro.ex:188: anonymous fn/4 in Macro.do_traverse/4
        (elixir) lib/enum.ex:1151: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3

12:57:43.336 [error] Task #PID<0.113.0> started from #PID<0.47.0> terminating
** (Protocol.UndefinedError) protocol Enumerable not implemented for nil
    (elixir) lib/enum.ex:1: Enumerable.impl_for!/1
    (elixir) lib/enum.ex:116: Enumerable.reduce/3
    (elixir) lib/enum.ex:679: Enum.fetch/2
    (elixir) lib/enum.ex:311: Enum.at/3
    lib/credo/check/readability/function_names.ex:43: Credo.Check.Readability.FunctionNames.issues_for_definition/3
    lib/credo/check/readability/function_names.ex:35: Credo.Check.Readability.FunctionNames.traverse/3
    (elixir) lib/macro.ex:188: anonymous fn/4 in Macro.do_traverse/4
    (elixir) lib/enum.ex:1151: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
Function: #Function<8.71295517/0 in Credo.Check.Runner.run/2>
    Args: []

12:57:43.351 [error] GenServer Credo.Supervisor terminating
** (Protocol.UndefinedError) protocol Enumerable not implemented for nil
    (elixir) lib/enum.ex:1: Enumerable.impl_for!/1
    (elixir) lib/enum.ex:116: Enumerable.reduce/3
    (elixir) lib/enum.ex:679: Enum.fetch/2
    (elixir) lib/enum.ex:311: Enum.at/3
    lib/credo/check/readability/function_names.ex:43: Credo.Check.Readability.FunctionNames.issues_for_definition/3
    lib/credo/check/readability/function_names.ex:35: Credo.Check.Readability.FunctionNames.traverse/3
    (elixir) lib/macro.ex:188: anonymous fn/4 in Macro.do_traverse/4
    (elixir) lib/enum.ex:1151: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
Last message: {:EXIT, #PID<0.47.0>, {%Protocol.UndefinedError{description: nil, protocol: Enumerable, value: nil}, [{Enumerable, :impl_for!, 1, [file: 'lib/enum.ex', line: 1]}, {Enumerable, :reduce, 3, [file: 'lib/enum.ex', line: 116]}, {Enum, :fetch, 2, [file: 'lib/enum.ex', line: 679]}, {Enum, :at, 3, [file: 'lib/enum.ex', line: 311]}, {Credo.Check.Readability.FunctionNames, :issues_for_definition, 3, [file: 'lib/credo/check/readability/function_names.ex', line: 43]}, {Credo.Check.Readability.FunctionNames, :traverse, 3, [file: 'lib/credo/check/readability/function_names.ex', line: 35]}, {Macro, :"-do_traverse/4-fun-0-", 4, [file: 'lib/macro.ex', line: 188]}, {Enum, :"-map_reduce/3-lists^mapfoldl/2-0-", 3, [file: 'lib/enum.ex', line: 1151]}]}}
State: {:state, {:local, Credo.Supervisor}, :one_for_one, [{:child, #PID<0.66.0>, Credo.Service.SourceFileScopes, {Credo.Service.SourceFileScopes, :start_link, []}, :permanent, 5000, :worker, [Credo.Service.SourceFileScopes]}, {:child, #PID<0.65.0>, Credo.Service.SourceFileCodeOnly, {Credo.Service.SourceFileCodeOnly, :start_link, []}, :permanent, 5000, :worker, [Credo.Service.SourceFileCodeOnly]}, {:child, #PID<0.64.0>, Credo.Service.SourceFileWithoutStringAndSigils, {Credo.Service.SourceFileWithoutStringAndSigils, :start_link, []}, :permanent, 5000, :worker, [Credo.Service.SourceFileWithoutStringAndSigils]}], :undefined, 3, 5, [], Supervisor.Default, {:ok, {{:one_for_one, 3, 5}, [{Credo.Service.SourceFileWithoutStringAndSigils, {Credo.Service.SourceFileWithoutStringAndSigils, :start_link, []}, :permanent, 5000, :worker, [Credo.Service.SourceFileWithoutStringAndSigils]}, {Credo.Service.SourceFileCodeOnly, {Credo.Service.SourceFileCodeOnly, :start_link, []}, :permanent, 5000, :worker, [Credo.Service.SourceFileCodeOnly]}, {Credo.Service.SourceFileScopes, {Credo.Service.SourceFileScopes, :start_link, []}, :permanent, 5000, :worker, [Credo.Service.SourceFileScopes]}]}}}
@rrrene
Copy link
Owner

rrrene commented Apr 5, 2016

Uh, that's looks ... like a bug 😁 Thx for reporting! 👍

@rrrene rrrene self-assigned this Apr 5, 2016
@iconnor
Copy link

iconnor commented Apr 7, 2016

Still failing for me with the same error when I ran it against https://github.com/phoenixframework/phoenix

@rrrene
Copy link
Owner

rrrene commented Apr 7, 2016

@iconnor This is because the fix is not yet deployed. The commit that fixes it is on the release branch for v0.4.0 - but I will try to make a patch release for this.

@rrrene rrrene closed this as completed in d1afb1a Apr 7, 2016
@rrrene
Copy link
Owner

rrrene commented Apr 7, 2016

@iconnor @mikesive This is released as v0.3.11!

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

3 participants