Skip to content
Closed
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
4 changes: 4 additions & 0 deletions HISTORY_v2.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v2.10.1

Fixed a formatting regression for BlueStyle introduced in 2.5.0. (#1013, #1193)

# v2.10.0

Added a new formatting option, `max_iterations`, which controls the number of rounds of formatting that JuliaFormatter will apply.
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "JuliaFormatter"
uuid = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
version = "2.10.0"
version = "2.10.1"
authors = ["Dominique Luna <dluna132@gmail.com> and contributors"]

[workspace]
Expand Down
4 changes: 3 additions & 1 deletion src/styles/blue/pretty.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ function is_binaryop_nestable(::BlueStyle, cst::JuliaSyntax.GreenNode)
# don't, there are idempotence issues because on the second pass this will return true.
# This is a massive pain to do though.
# See https://github.com/JuliaEditorSupport/JuliaFormatter.jl/issues/1175
if is_assignment(cst) && haschildren(cst) && is_iterable(cst[end])
if (is_assignment(cst) || defines_function(cst)) &&
haschildren(cst) &&
is_iterable(cst[end])
return false
end
return is_binaryop_nestable(DefaultStyle(), cst)
Expand Down
9 changes: 9 additions & 0 deletions test/issues.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2520,6 +2520,15 @@ end
end
end

@testset "1013" begin
s = "check_constraints(ex::Union{AbstractExpression,AbstractExpressionNode}, options::AbstractOptions)::Bool = check_constraints(ex, options, options.maxsize)"
out = """
check_constraints(ex::Union{AbstractExpression,AbstractExpressionNode}, options::AbstractOptions)::Bool = check_constraints(
ex, options, options.maxsize
)"""
test_format(s, out, BlueStyle())
end

@testset "1025" begin
# from julia@1.12.6 Compiler/src/typelimits.jl
s = """
Expand Down
Loading