Issues with JuliaFormatter and JET tests on 1.12

I have tests like this across a few packages:



    @testset verbose=true "Package Quality" begin

        @testset "Blue Formatting" begin
            @test_broken JuliaFormatter.format(MyPackage; verbose=false, overwrite=false)
        end

        @testset "JET.jl Code Linting" begin
            if VERSION >= v"1.11"
                JET.test_package(MyPackage; target_defined_modules=true)
            end
        end
    end

I have found that to get JET.jl to work with >=1.12 I’ve had to pin it to newer versions. I realize this is because JuliaFormatter.jl is currently stuck using JuliaSyntax.jl 0.4 and JET is currently needing v1.0. Because of this, I seem to only be able to either have my JET tests work error free, or my JuliaFormatter tests work (they just persistently fail even if I have the code formatted). Just curious if anyone has found a workaround for this/experienced this or if I’m missing something silly.

My conclusion from similar struggles is that JuliaFormatter should not run as part of the tests themselves, but typically as a pre-commit hook, or at the very least a separate CI job. I plan to update ModernJuliaWorkflows to reflect this newfound wisdom.

1 Like

Got it. That makes sense to me!

I think BestieTemplate.jl has a decent setup for this kind of stuff

2 Likes