In Episode 193 we covered the code linting tool Dogma. Dogma aims to strictly enforce a particular set of rules. Credo is a similar tool, but it's focused on giving gentle suggestions rather than strict enforcement. As a result, it's also going to find more issues with your code. You don't need to fix them all, but it gives good suggestions on things you might want to address. Let's have a look.

We're going to run this on ElixirFriends. First thing's first, we pull it in as a dependency.

vim mix.exs
 {:credo, "~> 0.2", only: [:dev, :test]}

Fetch it:

mix deps.get

Now we're ready to run it:

mix credo

By default it just shows you a few things you could fix. If you want to see the entire list of issues Credo found, you can add a -a to it:

mix credo -a

The next feature is really sweet. It's called explain - you basically take the line and column number data and pass that to credo:

mix credo web/views/post_view.ex:22:7

So the nice thing here is...