From 4d4f10e8a37675bc6196a0837580d1db11d21ef9 Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Mon, 15 Dec 2025 09:52:00 +0100 Subject: [PATCH 1/3] Fix JET tests --- test/Project.toml | 1 - test/runtests.jl | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/Project.toml b/test/Project.toml index 217d62c9..284f410b 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -15,7 +15,6 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" HiGHS = "87dc4568-4c63-4d18-b0c0-bb2238e4078b" JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" JuMP = "4076af6c-e467-56ae-b986-b466b2749572" -JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MatrixDepot = "b51810bb-c9f3-55da-ae3c-350fc1fbce05" MiniZinc = "a7f392d2-6c35-496e-b8cc-0974fbfcbf91" diff --git a/test/runtests.jl b/test/runtests.jl index 7a070756..57d858e5 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -19,10 +19,12 @@ include("utils.jl") else @testset verbose = true "Code quality" begin @testset "Aqua" begin - Aqua.test_all(SparseMatrixColorings; stale_deps = (; ignore = [:Requires])) + Aqua.test_all(SparseMatrixColorings; undocumented_names=true) end @testset "JET" begin - JET.test_package(SparseMatrixColorings; target_defined_modules = true) + JET.test_package( + SparseMatrixColorings; target_modules=(SparseMatrixColorings,) + ) end # @testset "JuliaFormatter" begin # TODO: switch to Runic (temporarily deactivated) From 202ca132d672aca88b3914ec590ab265940a89c1 Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Mon, 15 Dec 2025 10:01:30 +0100 Subject: [PATCH 2/3] Move JuliaFormatter to action --- .github/workflows/Format.yml | 12 ++++++++++++ test/runtests.jl | 7 ------- 2 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/Format.yml diff --git a/.github/workflows/Format.yml b/.github/workflows/Format.yml new file mode 100644 index 00000000..dd2b2c50 --- /dev/null +++ b/.github/workflows/Format.yml @@ -0,0 +1,12 @@ +name: Format suggestions +on: + pull_request: + # this argument is not required if you don't use the `suggestion-label` input + types: [opened, reopened, synchronize, labeled, unlabeled] +jobs: + code-style: + runs-on: ubuntu-latest + steps: + - uses: julia-actions/julia-format@v4 + with: + version: '1' # Set `version` to '1.0.54' if you need to use JuliaFormatter.jl v1.0.54 (default: '1') diff --git a/test/runtests.jl b/test/runtests.jl index 57d858e5..9494e5e2 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,7 +1,6 @@ using Aqua using Documenter using JET -using JuliaFormatter using SparseMatrixColorings using Test @@ -26,12 +25,6 @@ include("utils.jl") SparseMatrixColorings; target_modules=(SparseMatrixColorings,) ) end - # @testset "JuliaFormatter" begin - # TODO: switch to Runic (temporarily deactivated) - # @test JuliaFormatter.format( - # SparseMatrixColorings; verbose=false, overwrite=false - # ) - # end @testset "Doctests" begin Documenter.doctest(SparseMatrixColorings) end From 5766a36da6239f839d89ee72aaca5e975dc81568 Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Mon, 15 Dec 2025 10:11:41 +0100 Subject: [PATCH 3/3] Fix formatting --- ext/SparseMatrixColoringsColorsExt.jl | 5 ++--- src/postprocessing.jl | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/ext/SparseMatrixColoringsColorsExt.jl b/ext/SparseMatrixColoringsColorsExt.jl index 7f844e89..c934b5e9 100644 --- a/ext/SparseMatrixColoringsColorsExt.jl +++ b/ext/SparseMatrixColoringsColorsExt.jl @@ -271,9 +271,8 @@ function show_colors!( A_ccolor_indices = mod1.(column_colors(res), length(colorscheme)) A_rcolor_indices = mod1.(row_shift .+ row_colors(res), length(colorscheme)) B_ccolor_indices = mod1.(1:maximum(column_colors(res)), length(colorscheme)) - B_rcolor_indices = mod1.( - (row_shift + 1):(row_shift + maximum(row_colors(res))), length(colorscheme) - ) + B_rcolor_indices = + mod1.((row_shift + 1):(row_shift + maximum(row_colors(res))), length(colorscheme)) A_ccolors = colorscheme[A_ccolor_indices] A_rcolors = colorscheme[A_rcolor_indices] B_ccolors = colorscheme[B_ccolor_indices] diff --git a/src/postprocessing.jl b/src/postprocessing.jl index 9b0443b2..7b2b58f5 100644 --- a/src/postprocessing.jl +++ b/src/postprocessing.jl @@ -109,9 +109,7 @@ function postprocess_with_star_set!( end function postprocess_with_tree_set!( - color_used::Vector{Bool}, - color::AbstractVector{<:Integer}, - tree_set::TreeSet, + color_used::Vector{Bool}, color::AbstractVector{<:Integer}, tree_set::TreeSet ) # only the colors of non-leaf vertices are used (; reverse_bfs_orders, is_star, tree_edge_indices, nt) = tree_set