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

Report which module has undefined exports #176

Closed
nickrobinson251 opened this issue Sep 12, 2023 · 1 comment · Fixed by #177
Closed

Report which module has undefined exports #176

nickrobinson251 opened this issue Sep 12, 2023 · 1 comment · Fixed by #177

Comments

@nickrobinson251
Copy link

I'm trying using Aqua.jl for the very first time. Thanks for creating it!

I ran test_undefined_exports on a large codebase with many submodules, and got a test failure with message:

  Expression: undefined_exports(m) == []
   Evaluated: [:compile, :init_iterator, :seek_lub_foward!, :has_type, :is_betree, :key_type, :value_type, :Monoid, :group_inv, :semigroup_mul, :faqtorizer_aggressiveness, :start_arrow_conversion_iterate, :RPCEntry, :combine_tuples] == Any[]

but unfortunately i've upwards of 20 modules and a few hundred files in which these export statements could be living, and given some of the generic names (e.g. :compile) it takes more than a simple grep to find the offending lines.

I wonder if we could instead be printing out at least which module has the undefined export?

e.g. perhaps just as simple a change as pushing the module name along with the undefined name?

--- a/src/exports.jl
+++ b/src/exports.jl
@@ -13,13 +13,13 @@ function walkmodules(f, x::Module)
 end

 """
-    undefined_exports(m::Module) :: Vector{Symbol}
+    undefined_exports(m::Module) :: Vector
 """
 function undefined_exports(m::Module)
-    undefined = Symbol[]
+    undefined = Any[]
     walkmodules(m) do x
         for n in names(x)
-            isdefined(x, n) || push!(undefined, n)
+            isdefined(x, n) || push!(undefined, (x, n))
         end
     end
     return undefined
@lgoettgens
Copy link
Collaborator

Great idea, Thanks for the suggestion!

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

Successfully merging a pull request may close this issue.

2 participants