rebar3_hank Hex pm

The Erlang Dead Code Cleaner

Kill it with Fire

Mr. Scorpio says productivity is up 2%, and it's all because of my motivational techniques, like donuts and the possibility of more donuts to come.

(Homer Simpsons)

Build

$ rebar3 compile

Test

$ rebar3 test

Use

Add the plugin to your rebar config:

{project_plugins, [rebar3_hank]}

Then just call the plugin directly in an existing application:

$ rebar3 hank # or…
$ rebar3 kiwf # (Kill It With Fire)

This will review your project, analyzing every *.[he]rl file in it (optionally skipping some folders/files if you want to - see below). It will then apply its rules and produce a list of all the dead code that you can effectively delete and/or refactor.

Certainty

In principle, Hank should have Dialyzer levels of certainty. That is: if Hank points at some code, you can be 100% sure it's dead.

That means that if you find some false positives (i.e. Hank pointed at some code that was not really dead / should not be deleted), please report it as a bug and we'll take care of fixing it.

Configuration

The plugin supports the following configuration options in the hank section of rebar.config:

Rules

Find detailed information about the rules provided by Hank in hex docs.