JuliaTesting / Aqua.jl

Auto QUality Assurance for Julia packages
MIT License
342 stars 25 forks source link

Feature request: use color to improve readability of various reports #225

Open fingolfin opened 1 year ago

fingolfin commented 1 year ago

I really like how JET uses color to make its reports more readable.

Perhaps we can do the same for Aqua. E.g. in such a report:

Ambiguity #1
rand(X, t::Type{<:Array}, dims::Integer...) @ RandomExtensions ~/.julia/packages/RandomExtensions/4ml47/src/containers.jl:106
rand(L::AbstractAlgebra.Generic.Loc{T}, num_scale, den_scale) where T<:ZZRingElem @ Nemo ~/Projekte/OSCAR/Nemo.jl/src/HeckeMoreStuff.jl:1077

Possible fix, define
  rand(::AbstractAlgebra.Generic.Loc{T}, ::Type{<:Array}, ::Integer) where T<:Nemo.ZZRingElem

Ambiguity #2
*(a::T, b::AbstractAlgebra.FracElem{T}) where T<:RingElem @ AbstractAlgebra ~/.julia/packages/AbstractAlgebra/dsta0/src/Fraction.jl:345
*(a::Nemo.ZZRingElem, b::AbstractAlgebra.FracElem) @ Nemo ~/Projekte/OSCAR/Nemo.jl/src/flint/adhoc.jl:450

Possible fix, define
  *(::T, ::AbstractAlgebra.FracElem{T}) where T<:Nemo.ZZRingElem

I would imagine that Ambiguity #1 etc. gets one color, Possible fix, define another; but then also the method names could be colored as well as filenames etc.

The JET printing code is quite elaborate but I think we could get already get substantial benefits with something much simpler (e.g. a lot of the complexity in JET is having to deal with visualizing a "stack" nicely, which in e.g. the ambiguities report is not needed at all.

lgoettgens commented 1 year ago

We could even use the new StyledStrings.jl for this. That should make it a lot easier to implement

fingolfin commented 1 year ago

But StyledStrings.jl currently requires Julia 1.11 ... though there seem to be plans to make a release for Julia >= 1.0 at some point