{"action":"created","issue":{"url":"https://api.github.com/repos/rrrene/credo/issues/173","repository_url":"https://api.github.com/repos/rrrene/credo","labels_url":"https://api.github.com/repos/rrrene/credo/issues/173/labels{/name}","comments_url":"https://api.github.com/repos/rrrene/credo/issues/173/comments","events_url":"https://api.github.com/repos/rrrene/credo/issues/173/events","html_url":"https://github.com/rrrene/credo/issues/173","id":178783593,"number":173,"title":"function_name used for Stream.repeatedly includes argument","user":{"login":"KronicDeth","id":298259,"avatar_url":"https://avatars.githubusercontent.com/u/298259?v=3","gravatar_id":"","url":"https://api.github.com/users/KronicDeth","html_url":"https://github.com/KronicDeth","followers_url":"https://api.github.com/users/KronicDeth/followers","following_url":"https://api.github.com/users/KronicDeth/following{/other_user}","gists_url":"https://api.github.com/users/KronicDeth/gists{/gist_id}","starred_url":"https://api.github.com/users/KronicDeth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KronicDeth/subscriptions","organizations_url":"https://api.github.com/users/KronicDeth/orgs","repos_url":"https://api.github.com/users/KronicDeth/repos","events_url":"https://api.github.com/users/KronicDeth/events{/privacy}","received_events_url":"https://api.github.com/users/KronicDeth/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-23T04:43:06Z","updated_at":"2016-09-28T11:41:39Z","closed_at":"2016-09-28T10:56:00Z","body":"I was trying to ignore `Stream.repeatedly` for `Credo.Check.Refactor.PipeChainStart` and I couldn't get it to work, so I added some print debugging and discovered the `function_name` includes the argument:\r\n\r\n```\r\n  defp valid_chain_start?({{:., _, _}, _, _} = ast, excluded_functions) do\r\n    function_name = to_function_call_name(ast)\r\n\r\n    if excluded_functions |> Enum.member?(function_name) do\r\n      true\r\n    else\r\n      IO.puts \"function_name = #{inspect function_name}\"\r\n      false\r\n    end\r\n  end\r\n```\r\n\r\nThe `if` is the modification to the source.  The output:\r\n\r\n```\r\nfunction_name = \"Stream.repeatedly(fn ->\\n  {:ok, job_created_by_pid} = Client.Job.create_dag(interpreter_connection_created_by_pid, context)\\n  {:ok, %{^job_client_pid => job}} = Client.Job.with_job_assignment_state(job_created_by_pid, context, %{}, \\\"invited\\\")\\n  job\\nend)\"\r\n```\r\n\r\nFrom this test:\r\n\r\n```\r\njobs = Stream.repeatedly(fn ->\r\n             {:ok, job_created_by_pid} = Client.Job.create_dag(interpreter_connection_created_by_pid, context)\r\n             {:ok, %{^job_client_pid => job}} = Client.Job.with_job_assignment_state(\r\n               job_created_by_pid,\r\n               context,\r\n               %{},\r\n               \"invited\"\r\n             )\r\n\r\n             job\r\n           end)\r\n           |> Enum.take(2)\r\n```"},"comment":{"url":"https://api.github.com/repos/rrrene/credo/issues/comments/250143466","html_url":"https://github.com/rrrene/credo/issues/173#issuecomment-250143466","issue_url":"https://api.github.com/repos/rrrene/credo/issues/173","id":250143466,"user":{"login":"rrrene","id":311914,"avatar_url":"https://avatars.githubusercontent.com/u/311914?v=3","gravatar_id":"","url":"https://api.github.com/users/rrrene","html_url":"https://github.com/rrrene","followers_url":"https://api.github.com/users/rrrene/followers","following_url":"https://api.github.com/users/rrrene/following{/other_user}","gists_url":"https://api.github.com/users/rrrene/gists{/gist_id}","starred_url":"https://api.github.com/users/rrrene/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rrrene/subscriptions","organizations_url":"https://api.github.com/users/rrrene/orgs","repos_url":"https://api.github.com/users/rrrene/repos","events_url":"https://api.github.com/users/rrrene/events{/privacy}","received_events_url":"https://api.github.com/users/rrrene/received_events","type":"User","site_admin":false},"created_at":"2016-09-28T11:41:39Z","updated_at":"2016-09-28T11:41:39Z","body":"@KronicDeth Thx for reporting!\r\n\r\n@lucas-nelson Thx! That was the fix! :+1:"}}
{"actor":{"display_login":"rrrene"}}