Checking ambiguities in Aqua.jl

First of all, I love GitHub - JuliaTesting/Aqua.jl: Auto QUality Assurance for Julia packages

But every time I use it, it spits out a lot of warnings for method ambiguities in my dependencies, so I generally end up disabling this particular line of testing. Is there any way around it?

What do you mean by “disable” and “way around” ? I mean can you be more explicit.
I am trying the following at the moment

using MyModule
using Aqua: Aqua

@testset "aqua deps compat" begin

# This often gives false positive
# @testset "aqua project toml formatting" begin
#     Aqua.test_project_toml_formatting(MyModule)
# end

@testset "aqua unbound_args" begin

@testset "aqua undefined exports" begin

# Perhaps some of these should be fixed. Some are for combinations of types
# that make no sense.
# @testset "aqua test ambiguities" begin
#     Aqua.test_ambiguities([MyModule, Core, Base])
# end

@testset "aqua piracy" begin

@testset "aqua project extras" begin

@testset "aqua state deps" begin

This lets me see more clearly and quickly what is passing. And a psych boost by seeing more green when things work.

I find that the ambiguities sometimes occur with types pulled in from somewhere down in the dependency stack. They involve combinations of types that will probably never make sense. Fixing them would require referencing symbols from some package that I didnt even know was an indirect dependency… Having said that, and knowing this is probably added by tkf, I bet there is a cleaner solution that I dont know about.

I would like to disable these things on a peritem basis. But that might end up littering files with exceptions like you get in python land.

1 Like

For example I disabled the Project.toml check because there appears to be a bug or version slip between Aqua and Julia. I can run instantiate and resolve as many times as I want and Aqua still reports than running resolve would change Project.toml. Should probably figure out what issue to open and where to open it.

But I agree, Julia could use a better QA culture, and Aqua is an enormously helpful tool to aid in building this.

Hey @jlapeyre,
By disabling ambiguity testing, I mean setting ambiguities = false in the test_all function. This is basically equivalent to what you do by commenting the various individual tests.
My suspicion is because of the stack of dependencies, this is unsolvable until everyone uses Aqua, but I was just curious if anyone had found a useful workaround.

I was guessing that’s what you meant. I still don’t have an idea of what a workaround would look like. Maybe you don’t either, which is why you are asking!

My imagination only gives me: 1) Fix the ambiguities or 2) Don’t test for ambiguities. I can’t think of a third option.

It’s a bit unfortunate that Aqua does not yet have (AFAIK) the ability to overlook single offenses. I did find it caught some ambiguities that might reasonably occur.

Or I could try harder to fix the ambiguities without importing extraneous code. Maybe try to make the methods less general.