ericphanson / ExplicitImports.jl

Developer tooling for Julia namespace management: detecting implicit imports, improper explicit imports, and improper qualified accesses
https://ericphanson.github.io/ExplicitImports.jl/
MIT License
62 stars 2 forks source link

modules exporting names which aren't theirs #29

Closed baggepinnen closed 1 month ago

baggepinnen commented 3 months ago

Here's a fun one

UUID belongs to base

julia> parentmodule(Base.UUID)
Base

but is not exported by Base

julia> UUID
ERROR: UndefVarError: `UUID` not defined

However, it is exported by UUIDs

julia> using UUIDs

julia> UUID
UUID

julia> parentmodule(UUID)
Base

When running ExplicitImports on ControlSystemsBase, I got

using UUIDs: UUIDs

which then makes UUID no longer imported by CSBase and tests are failing. Would there be a way to detect this happening?

ericphanson commented 3 months ago

ah yeah, this is tricky. I think https://github.com/ericphanson/ExplicitImports.jl/pull/28 could help here. In that PR I track things a bit better so I think I could handle this.