Elixir Static Code Analysis in Vim
<img src="https://i.imgur.com/OA81WdJ.png" title="source: imgur.com" />Today I learned how to set up Credo, a static analysis tool for Elixir, to run on every Vim buffer write, using Neomake.
To start, I added Credo to my project:
# mix.exs
defp deps do
{:credo, "~> 0.8", only: [:dev, :test], runtime: false}
end
Including it with:
$ mix deps.get
Next, I loaded and sourced the Neomake plugin with Pathogen:
" ~/.vimbundle
neomake/neomake
Next, I told Neomake to run on every file, enabling Credo for Elixir files:
" ~/.vimrc
let g:neomake_elixir_enabled_makers = ['credo']
autocmd! BufWritePost * Neomake
Now I have Credo style recommendations right in my text editor.
Tweet