New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: extension of ignore_xref and xref_ignores to support ignoring entire modules #1905

Open
elbrujohalcon opened this Issue Oct 5, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@elbrujohalcon
Contributor

elbrujohalcon commented Oct 5, 2018

Current behaviour

rebar3 xref supports two ways to ignore one or more xref warnings:

  • Using the rebar.config param xref_ignores
  • Using the attribute -ignore_xref(…). in any of the analyzed modules.

Those two ways support a list of tuples as arguments, it's actual spec being:

  {module(), function(), arity()} % Ignores warnings for that particular function
| {module(), function()} % Ignores warnings for any function with that name in that module, regardless of its arity

Expected behaviour

I would like to add a new format for those configurations, in order to allow whole modules to be ignored. The spec would end up as…

  {module(), function(), arity()} % Ignores warnings for that particular function
| {module(), function()} % Ignores warnings for any function with that name in that module, regardless of its arity
| module() % Ignores warnings for any function in that mdoule

Context

In a large system, I would like to enable unused_exports as part of the xref checks, to detect… well… unused exports :trollface:. But I can't since I'm using gpb and it generates modules with tons of unused exports and there is no way to add all the corresponding functions to xref_ignores. It would be super convenient to be able to just add the name of the modules that are auto-generated so that they can be ignored entirely.

@ferd ferd added the enhancement label Oct 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment