# Checking ambiguities in Aqua.jl

**URL:** https://discourse.julialang.org/t/checking-ambiguities-in-aqua-jl/96908
**Category:** General Usage
**Tags:** testing, aqua
**Created:** [March 31, 2023, 6:48pm UTC](https://discourse.julialang.org/t/checking-ambiguities-in-aqua-jl/96908 "2023-03-31T18:48:29Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)
#### Post date: [March 31, 2023, 6:48pm UTC](https://discourse.julialang.org/t/checking-ambiguities-in-aqua-jl/96908/1 "2023-03-31T18:48:29Z")

</div>

First of all, I love [GitHub - JuliaTesting/Aqua.jl: Auto QUality Assurance for Julia packages](https://github.com/JuliaTesting/Aqua.jl)

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?

---

<div class="post-metadata">

### Author: ![jlapeyre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlapeyre/32/4514_2.png) [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)
#### Post date: [March 31, 2023, 7:06pm UTC](https://discourse.julialang.org/t/checking-ambiguities-in-aqua-jl/96908/2 "2023-03-31T19:06:16Z")

</div>

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

```julia
using MyModule
using Aqua: Aqua

@testset "aqua deps compat" begin
    Aqua.test_deps_compat(MyModule)
end

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

@testset "aqua unbound_args" begin
    Aqua.test_unbound_args(MyModule)
end

@testset "aqua undefined exports" begin
    Aqua.test_undefined_exports(MyModule)
end

# 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
    Aqua.test_piracy(MyModule)
end

@testset "aqua project extras" begin
    Aqua.test_project_extras(MyModule)
end

@testset "aqua state deps" begin
    Aqua.test_stale_deps(MyModule)
end

```

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.

---

<div class="post-metadata">

### Author: ![jlapeyre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlapeyre/32/4514_2.png) [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)
#### Post date: [March 31, 2023, 7:09pm UTC](https://discourse.julialang.org/t/checking-ambiguities-in-aqua-jl/96908/3 "2023-03-31T19:09:35Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)
#### Post date: [April 1, 2023, 10:46am UTC](https://discourse.julialang.org/t/checking-ambiguities-in-aqua-jl/96908/4 "2023-04-01T10:46:22Z")

</div>

Hey @jlapeyre,  
By disabling ambiguity testing, I mean setting `ambiguities = false` in the [`test_all`](https://juliatesting.github.io/Aqua.jl/stable/#Aqua.test_all-Tuple%7BModule%7D) 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.

---

<div class="post-metadata">

### Author: ![jlapeyre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlapeyre/32/4514_2.png) [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)
#### Post date: [April 1, 2023, 12:48pm UTC](https://discourse.julialang.org/t/checking-ambiguities-in-aqua-jl/96908/5 "2023-04-01T12:48:05Z")

</div>

> [@gdalle](#):
>
> I mean setting `ambiguities = false`

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.
