Skip to content
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

xref: Ignore unused function in any module #2944

Open
denizdogan opened this issue Mar 17, 2025 · 1 comment
Open

xref: Ignore unused function in any module #2944

denizdogan opened this issue Mar 17, 2025 · 1 comment

Comments

@denizdogan
Copy link

I have a project with hundreds of modules with an exported start_link/1 function. Can I configure Xref to ignore exports_not_used for any such function?

@ferd
Copy link
Collaborator

ferd commented Mar 17, 2025

I think you can, but it will require specific xref formulas (see https://www.erlang.org/doc/apps/tools/xref.html).

It looks like our default expression is:

"(xc - uc) || (xu - x - b - (\"mod\":\".*foo\"/\"4\"))"
 (external calls - unresolved) OR (externally used - exported - used BIFS - (mod:*foo/4))

I think you might be able to add something like (...) - (\"*\":\"start_link\"/\"*\") in there to ignore all start_link calls, but I'm not sure, I haven't used the set syntax from xref a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants