rrrene / credo

A static code analysis tool for the Elixir language with a focus on code consistency and teaching.
http://credo-ci.org/
MIT License
4.91k stars 415 forks source link

Fixes unused function warning in MixEnv check #1090

Closed antedeguemon closed 10 months ago

antedeguemon commented 10 months ago

Hi! 🖖

There is a warning getting logged when compiling Credo.Check.Warning.MixEnv:

❯ mix compile lib/credo/check/warning/mix_env.ex
Compiling 1 file (.ex)
    warning: function traverse/4 is unused
    │
 56 │     defp traverse({unquote(op), _, nil} = ast, issues, _issue_meta, _parens?) do
    │          ~
    │
    └─ lib/credo/check/warning/mix_env.ex:56:10: Credo.Check.Warning.MixEnv (module)

This pull request fixes it by removing the extra parens? argument from the traverse function and adds a little test to ensure nothing is broken.