Skip to content

Commit 0702578

Browse files
authored
Fix JET tests (#285)
* Fix JET tests * Move JuliaFormatter to action * Fix formatting
1 parent e2f039d commit 0702578

File tree

5 files changed

+20
-17
lines changed

5 files changed

+20
-17
lines changed

.github/workflows/Format.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Format suggestions
2+
on:
3+
pull_request:
4+
# this argument is not required if you don't use the `suggestion-label` input
5+
types: [opened, reopened, synchronize, labeled, unlabeled]
6+
jobs:
7+
code-style:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: julia-actions/julia-format@v4
11+
with:
12+
version: '1' # Set `version` to '1.0.54' if you need to use JuliaFormatter.jl v1.0.54 (default: '1')

ext/SparseMatrixColoringsColorsExt.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,8 @@ function show_colors!(
271271
A_ccolor_indices = mod1.(column_colors(res), length(colorscheme))
272272
A_rcolor_indices = mod1.(row_shift .+ row_colors(res), length(colorscheme))
273273
B_ccolor_indices = mod1.(1:maximum(column_colors(res)), length(colorscheme))
274-
B_rcolor_indices = mod1.(
275-
(row_shift + 1):(row_shift + maximum(row_colors(res))), length(colorscheme)
276-
)
274+
B_rcolor_indices =
275+
mod1.((row_shift + 1):(row_shift + maximum(row_colors(res))), length(colorscheme))
277276
A_ccolors = colorscheme[A_ccolor_indices]
278277
A_rcolors = colorscheme[A_rcolor_indices]
279278
B_ccolors = colorscheme[B_ccolor_indices]

src/postprocessing.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,7 @@ function postprocess_with_star_set!(
109109
end
110110

111111
function postprocess_with_tree_set!(
112-
color_used::Vector{Bool},
113-
color::AbstractVector{<:Integer},
114-
tree_set::TreeSet,
112+
color_used::Vector{Bool}, color::AbstractVector{<:Integer}, tree_set::TreeSet
115113
)
116114
# only the colors of non-leaf vertices are used
117115
(; reverse_bfs_orders, is_star, tree_edge_indices, nt) = tree_set

test/Project.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
1515
HiGHS = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"
1616
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
1717
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
18-
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
1918
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
2019
MatrixDepot = "b51810bb-c9f3-55da-ae3c-350fc1fbce05"
2120
MiniZinc = "a7f392d2-6c35-496e-b8cc-0974fbfcbf91"

test/runtests.jl

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using Aqua
22
using Documenter
33
using JET
4-
using JuliaFormatter
54
using SparseMatrixColorings
65
using Test
76

@@ -19,17 +18,13 @@ include("utils.jl")
1918
else
2019
@testset verbose = true "Code quality" begin
2120
@testset "Aqua" begin
22-
Aqua.test_all(SparseMatrixColorings; stale_deps = (; ignore = [:Requires]))
21+
Aqua.test_all(SparseMatrixColorings; undocumented_names=true)
2322
end
2423
@testset "JET" begin
25-
JET.test_package(SparseMatrixColorings; target_defined_modules = true)
26-
end
27-
# @testset "JuliaFormatter" begin
28-
# TODO: switch to Runic (temporarily deactivated)
29-
# @test JuliaFormatter.format(
30-
# SparseMatrixColorings; verbose=false, overwrite=false
31-
# )
32-
# end
24+
JET.test_package(
25+
SparseMatrixColorings; target_modules=(SparseMatrixColorings,)
26+
)
27+
end
3328
@testset "Doctests" begin
3429
Documenter.doctest(SparseMatrixColorings)
3530
end

0 commit comments

Comments
 (0)