One task to rule all Elixir analysis & testing tools

clock2 min read

Here’s how to spend less time managing & running all the tools that assist in developing top-notch Elixir code.

Elixir ecosystem matures with more and more of amazing tools to support producing code which is bug-free (compiler, ex_unit, dialyzer), maintainable (formatter, ex_doc, credo) and secure (sobelow). Recently though I woke up with a feeling that we Elixir developers don’t put enough attention to managing and running these tools in a comfortable and efficient way.

Here's the problem. Regardless if you’re starting your very first Elixir project or yet another library-wannabe prototype, you’ll have to take care of the following matters:

  • discover and memorize the list of all analysis and testing tools
  • add all of them to every new project
  • sync the list for every existing project once new fancy tool comes out
  • run all of them by hand before every code push
  • include all of them in the CI build script
  • re-run them multiple times in order to see all errors

I don't know about you but for me these errands definitely fall outside of my definition of "fun".

Introducing mix check

And so I’ve created ex_check — a tool that solves these challenges in order to save you some of your precious coding time while still ensuring top code quality in every single one of your projects. Right from the very first commit and without the headache.

Once you add the ex_check package to your project (as described in the getting started section of README), the mix check task will become available as your One Task To Rule Them All™

And as we all came here to save some time, let’s get right to the demo: 

Voila! All the built-in checks are being run in parallel, their output is delivered instantly and you are hinted about the possibility of expanding your toolset with other curated tools. Of course, you can disable some tools permanently, customize the commands or even add entirely new tools - in any case the mix check.gen.config generator will have you covered.

Check out the docs for mix config on HexDocs (or read them via mix help check) in order to learn more about the task workflow, included tools, configuration and options.

Happy che... I mean happy coding!