AdRoll / rebar3_hank

The Erlang Dead Code Cleaner
MIT License
68 stars 9 forks source link

[unused_callbacks] Detect callbacks present in macro definitions #81

Closed pbrudnick closed 3 years ago

pbrudnick commented 3 years ago

Bug Description

Related to #76 A macro that contains the callback atom and it's being used within the module is not detected.

To Reproduce

-module(macros).

-callback used_callback() -> this | one | is | used | through | the | macro.

-define(CALLBACK, used_callback).

-export([using_the_callback/1]).

using_the_callback(Module) ->
    Module:?CALLBACK().

hank returns:

"Callback used_callback/0 is not used anywhere in the module"

Expected Behavior

It should be considered as a used callbacks throwing no warnings.