AdRoll / rebar3_hank

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

[unused_hrls] Figure out the actual path of an include file, don't guess #31

Open elbrujohalcon opened 3 years ago

elbrujohalcon commented 3 years ago

Currently, unused_hrls might retrun some false negatives. For instance, it may think that lib/app1/include/header.hrl is used if lib/app2/src/module.erl contains -include("header.hrl"). when, in reality, module.erl is including lib/app2/include/header.erl or lib/app2/src/header.hrl. To prevent this situation we need to properly retrieve the absolute path of "header.hrl" in the same way that the Erlang pre-processor retrieves it.