JuliaTesting / Aqua.jl

Auto QUality Assurance for Julia packages
MIT License
334 stars 24 forks source link

Feature request: test that no two modules export the same name #291

Open Octogonapus opened 4 months ago

Octogonapus commented 4 months ago

This is a feature request for a check that each module's set of exported names is totally unique. I'm talking about this scenario:

julia> module A
       export foo
       foo()=1
       end
Main.A

julia> module ^C

julia> module B
       export foo
       foo()=1
       end
Main.B

julia> using .A

julia> using .B

julia> foo
WARNING: both B and A export "foo"; uses of it in module Main must be qualified

You can see that both modules export the same name, and therefore its use must be qualified. I'm developing a set of packages containing autogenerated bindings, and sometimes we end up with two packages generating overlapping bindings. This is our fault, but it can be hard to check. If Aqua had a check like this, that would be very helpful.

I can put some time into developing this if this feature would be accepted. I'm also 100% okay with this being behind some feature flag, because I would expect that most users don't want such a check.