ExplicitImports.jl
ExplicitImports.jl copied to clipboard
Check all imports are via `using` (not `import`)
Would very much like this feature -- does it seem possible and a fit for this package?
i.e. convert
import Foo
import Bar: baz
to
using Foo: Foo
using Bar: Bar, baz
Users may need to change their code (if they previously extended baz like baz() = ... to do so like Bar.baz() = ...) so we'd have to tell them to do that in the text output i guess
(Perhaps we could even identify if any methods were extended this way? And list them? And choose between using Bar: Bar, baz and using Bar: baz appropriately?)
JuliaFormatter can do the toplevel conversion, but I don’t think it makes method definitions use the qualified name: https://domluna.github.io/JuliaFormatter.jl/dev/#import_to_using
We could probably do both but it would be a bit of a lift to be fully semantic rather than find and replace. Definitely lower priority than #114