Skip to content

Allow JuliaFormatter v2 + run formatter #435

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ArnoldiMethod = "0.4"
DataStructures = "0.17, 0.18"
Documenter = "0.27"
Inflate = "0.1.3"
JuliaFormatter = "1"
JuliaFormatter = "1, 2"
SimpleTraits = "0.9"
StableRNGs = "1"
Statistics = "1"
Expand Down
3 changes: 2 additions & 1 deletion src/Experimental/Traversals/bfs.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Base.Sort, Base.Sort.Algorithm
using Base.Sort: Sort
using Base.Sort.Algorithm: Algorithm
import Base: sort!

struct NOOPSortAlg <: Base.Sort.Algorithm end
Expand Down
14 changes: 4 additions & 10 deletions src/Experimental/vf2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ function has_induced_subgraphisomorph(
edge_relation::Union{Nothing,Function}=nothing,
)::Bool
result = false
callback(vmap) = (result = true; return false)
callback(vmap) = (result=true; return false)
vf2(
callback,
g1,
Expand All @@ -509,7 +509,7 @@ function has_subgraphisomorph(
edge_relation::Union{Nothing,Function}=nothing,
)::Bool
result = false
callback(vmap) = (result = true; return false)
callback(vmap) = (result=true; return false)
vf2(
callback,
g1,
Expand All @@ -531,7 +531,7 @@ function has_isomorph(
!could_have_isomorph(g1, g2) && return false

result = false
callback(vmap) = (result = true; return false)
callback(vmap) = (result=true; return false)
vf2(
callback,
g1,
Expand Down Expand Up @@ -647,9 +647,6 @@ function all_subgraphisomorph(
return ch
end

#! format: off
# Turns off formatting from this point onwards

function all_isomorph(
g1::AbstractGraph,
g2::AbstractGraph,
Expand All @@ -658,7 +655,7 @@ function all_isomorph(
edge_relation::Union{Nothing,Function}=nothing,
)::Channel{Vector{Tuple{eltype(g1),eltype(g2)}}}
T = Vector{Tuple{eltype(g1),eltype(g2)}}
!could_have_isomorph(g1, g2) && return Channel(_ -> nothing, ctype = T)
!could_have_isomorph(g1, g2) && return Channel(_ -> nothing; ctype=T)
make_callback(c) = vmap -> (put!(c, collect(zip(vmap, 1:length(vmap)))), return true)
ch::Channel{T} = Channel(; ctype=T) do c
vf2(
Expand All @@ -672,6 +669,3 @@ function all_isomorph(
end
return ch
end

#! format: on
# Turns on formatting from this point onwards
2 changes: 1 addition & 1 deletion src/SimpleGraphs/generators/randgraphs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@ function stochastic_block_model(
for b in a:K
((a == b) && !(c[a, b] <= n[b] - 1)) ||
((a != b) && !(c[a, b] <= n[b])) && error(
"Mean degree cannot be greater than available neighbors in the block.",
"Mean degree cannot be greater than available neighbors in the block."
) # TODO 0.7: turn into some other error?

m = a == b ? div(n[a] * (n[a] - 1), 2) : n[a] * n[b]
Expand Down
Loading
Loading