Skip to content

Fix inline comment whitespace handling#1195

Merged
penelopeysm merged 3 commits into
masterfrom
comm
Jun 27, 2026
Merged

Fix inline comment whitespace handling#1195
penelopeysm merged 3 commits into
masterfrom
comm

Conversation

@penelopeysm

@penelopeysm penelopeysm commented Jun 27, 2026

Copy link
Copy Markdown
Member

Closes #1194, but need to evaluate the impact on other code first before merging.

I asked Claude "how hacky is this on a scale of 1 to 10":

A solid 8. The whole HASHEQCOMMENT handling in add_node! is a pile of special cases bolted onto a function that's already doing too much. add_node! is supposed to append a child to an FST node, but it's also:

  • Overriding its own join_lines parameter based on node type
  • Inserting synthetic Whitespace nodes on behalf of the caller
  • Making formatting decisions based on source positions

And that's just the HASHEQCOMMENT part. The broader add_node! function is ~200 lines of interleaved concerns: line tracking, comment insertion, nesting decisions, whitespace management, import transformation. Every new comment-related bug gets fixed by adding another if n.typ === HASHEQCOMMENT branch somewhere in the middle.

Personally I'd say 12, but well.

@penelopeysm

Copy link
Copy Markdown
Member Author

!formatbot JuliaLang/julia@v1.12.6 v2_stable_multiline_strings=true

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

FormatBot Results

Description Value
FormatBot workflow run workflow run
Target repo JuliaLang/julia@v1.12.6
JuliaFormatter base 24c872c
JuliaFormatter PR f2d95c5
Options v2_stable_multiline_strings=true

Caution

Formatting with PR is not idempotent!

Diff (29347 bytes)
diff --git a/Compiler/src/abstractinterpretation.jl b/Compiler/src/abstractinterpretation.jl
index 1a1673b..04eec19 100644
--- a/Compiler/src/abstractinterpretation.jl
+++ b/Compiler/src/abstractinterpretation.jl
@@ -115,6 +115,7 @@ mutable struct CallInferenceState
             Bottom,
             #=all_effects=#
             EFFECTS_TOTAL,
+
             #=const_results=#
             nothing,
             #=conditionals=#
@@ -3712,6 +3713,7 @@ function abstract_call_opaque_closure(
             const_call_result = abstract_call_method_with_const_args(
                 interp,
                 result,
+
                 #=f=#
                 nothing,
                 arginfo,
diff --git a/Compiler/src/ssair/tarjan.jl b/Compiler/src/ssair/tarjan.jl
index 6a6aed3..985a222 100644
--- a/Compiler/src/ssair/tarjan.jl
+++ b/Compiler/src/ssair/tarjan.jl
@@ -169,8 +169,10 @@ function tarjan!(
                             reach,
                             cfg,
                             convert(Int, item.v),
+
                             #= filter =#
                             (pred, x)->(filter(pred, x) && scc[x] > typemax(Int)÷2),
+
                             #= action =#
                             (x)->(scc[x] -= typemax(Int)÷2;),
                         )
@@ -254,9 +256,11 @@ function enqueue_if_unreachable!(reach::CFGReachability, cfg::CFG, bb::Int)
         scan_subgraph!(
             reach,
             cfg,
-            bb, # set this SCC to 0
+            bb,
+             # set this SCC to 0
             #= filter =#
             (pred, x)->(filter(pred, x) && scc[x] == scc′),
+
             #= action =#
             (x)->(scc[x] = 0;),
         )
diff --git a/Compiler/src/typeinfer.jl b/Compiler/src/typeinfer.jl
index 0c15807..80a03dc 100644
--- a/Compiler/src/typeinfer.jl
+++ b/Compiler/src/typeinfer.jl
@@ -1825,6 +1825,7 @@ function compile!(
             # make a best-effort attempt to enqueue the relevant code for the ccallable
             ptr = ccall(
                 :jl_get_specialization1,
+
                 #= MethodInstance =#
                 Ptr{Cvoid},
                 (Any, Csize_t, Cint),
diff --git a/Compiler/src/types.jl b/Compiler/src/types.jl
index c3318e2..f7966ca 100644
--- a/Compiler/src/types.jl
+++ b/Compiler/src/types.jl
@@ -258,25 +258,35 @@ struct InferenceParams
     end
 end
 function InferenceParams(
-    params::InferenceParams = InferenceParams( # default constructor
+    params::InferenceParams = InferenceParams(
+         # default constructor
         #=max_methods::Int=#
         BuildSettings.MAX_METHODS,
+
         #=max_union_splitting::Int=#
         4,
+
         #=max_apply_union_enum::Int=#
         8,
+
         #=max_tuple_splat::Int=#
         32,
+
         #=tuple_complexity_limit_depth::Int=#
         3,
+
         #=ipo_constant_propagation::Bool=#
         true,
+
         #=aggressive_constant_propagation::Bool=#
         false,
+
         #=assume_bindings_static::Bool=#
         false,
+
         #=ignore_recursion_hardlimit::Bool=#
         false,
+
         #=force_enable_inference::Bool=#
         false,
     );
@@ -380,20 +390,28 @@ struct OptimizationParams
 end
 function OptimizationParams(
     params::OptimizationParams = OptimizationParams(
+
         #=inlining::Bool=#
         inlining_enabled(),
+
         #=inline_cost_threshold::Int=#
         100,
+
         #=inline_nonleaf_penalty::Int=#
         1000,
+
         #=inline_tupleret_bonus::Int=#
         250,
+
         #=max_tuple_splat::Int=#
         32,
+
         #=compilesig_invokes::Bool=#
         true,
+
         #=assume_fatal_throw::Bool=#
         false,
+
         #=preserve_local_sources::Bool=#
         false,
     );
diff --git a/Compiler/src/verifytrim.jl b/Compiler/src/verifytrim.jl
index 553da38..ebb58b0 100644
--- a/Compiler/src/verifytrim.jl
+++ b/Compiler/src/verifytrim.jl
@@ -433,6 +433,7 @@ function get_verify_typeinf_trim(codeinfos::Vector{Any})
             sig = item[2]::Type
             ptr = ccall(
                 :jl_get_specialization1,
+
                 #= MethodInstance =#
                 Ptr{Cvoid},
                 (Any, Csize_t, Cint),
diff --git a/Compiler/test/abioverride.jl b/Compiler/test/abioverride.jl
index 12a4072..4c57a7f 100644
--- a/Compiler/test/abioverride.jl
+++ b/Compiler/test/abioverride.jl
@@ -46,10 +46,12 @@ let world = Base.tls_world_age()
     # Construct the CodeInstance from the modified CodeInfo data
     global new_ci = Core.CodeInstance(
         Core.ABIOverride(Tuple{typeof(myplus),Int}, mi),
+
         #=owner=#
         SecondArgConstOverride(1),
         new_source.rettype,
         Any #=new_source.exctype is missing=#,
+
         #=inferred_const=#
         nothing,
         #=code=#
@@ -60,6 +62,7 @@ let world = Base.tls_world_age()
         typemax(UInt),
         #=new_source.ipo_purity_bits is missing=#
         UInt32(0),
+
         #=analysis_results=#
         nothing,
         new_source.debuginfo,
diff --git a/Compiler/test/inference.jl b/Compiler/test/inference.jl
index 37707ac..1987385 100644
--- a/Compiler/test/inference.jl
+++ b/Compiler/test/inference.jl
@@ -2416,7 +2416,8 @@ end
             Core.svec(:X, :Y),
             false,
         ))
-        $(Expr(:meta, :generated_only)) #= no body =#
+        $(Expr(:meta, :generated_only))
+        #= no body =#
     end
 end
 
@@ -2428,15 +2429,18 @@ end
             Core.svec(:X, :Y),
             true,
         ))
-        $(Expr(:meta, :generated_only)) #= no body =#
+        $(Expr(:meta, :generated_only))
+        #= no body =#
     end
     function f24852_early_inflated(f, x::X, y::Y) where {X,Y}
         $(Expr(:meta, :generated, f24852_gen_cinfo_inflated))
-        $(Expr(:meta, :generated_only)) #= no body =#
+        $(Expr(:meta, :generated_only))
+        #= no body =#
     end
     function f24852_early_uninflated(f, x::X, y::Y) where {X,Y}
         $(Expr(:meta, :generated, f24852_gen_cinfo_uninflated))
-        $(Expr(:meta, :generated_only)) #= no body =#
+        $(Expr(:meta, :generated_only))
+        #= no body =#
     end
 end
 
@@ -5240,26 +5244,46 @@ g41908() = f41908(Any[1][1])
 
 # issue #42022
 let x = Tuple{Int,Any}[
+
         #= 1=#
-        (0, Expr(:(=), Core.SlotNumber(3), 1)) #= 2=#
-        (0, EnterNode(17)) #= 3=#
-        (2, Expr(:(=), Core.SlotNumber(3), 2.0)) #= 4=#
-        (2, EnterNode(12)) #= 5=#
-        (4, Expr(:(=), Core.SlotNumber(3), '3')) #= 6=#
-        (4, Core.GotoIfNot(Core.SlotNumber(2), 9)) #= 7=#
-        (4, Expr(:leave, Core.SSAValue(4), Core.SSAValue(2))) #= 8=#
-        (0, Core.ReturnNode(1)) #= 9=#
-        (4, Expr(:call, GlobalRef(Main, :throw))) #=10=#
-        (4, Expr(:leave, Core.SSAValue(4))) #=11=#
-        (2, Core.GotoNode(15)) #=12=#
-        (2, Expr(:(=), Core.SlotNumber(4), Expr(:the_exception))) #=13=#
-        (2, Expr(:call, GlobalRef(Main, :rethrow))) #=14=#
-        (2, Expr(:pop_exception, Core.SSAValue(4))) #=15=#
-        (2, Expr(:leave, Core.SSAValue(2))) #=16=#
-        (0, Core.GotoNode(20)) #=17=#
-        (0, Expr(:(=), Core.SlotNumber(5), Expr(:the_exception))) #=18=#
-        (0, nothing) #=19=#
-        (0, Expr(:pop_exception, Core.SSAValue(2))) #=20=#
+        (0, Expr(:(=), Core.SlotNumber(3), 1))
+        #= 2=#
+        (0, EnterNode(17))
+        #= 3=#
+        (2, Expr(:(=), Core.SlotNumber(3), 2.0))
+        #= 4=#
+        (2, EnterNode(12))
+        #= 5=#
+        (4, Expr(:(=), Core.SlotNumber(3), '3'))
+        #= 6=#
+        (4, Core.GotoIfNot(Core.SlotNumber(2), 9))
+        #= 7=#
+        (4, Expr(:leave, Core.SSAValue(4), Core.SSAValue(2)))
+        #= 8=#
+        (0, Core.ReturnNode(1))
+        #= 9=#
+        (4, Expr(:call, GlobalRef(Main, :throw)))
+        #=10=#
+        (4, Expr(:leave, Core.SSAValue(4)))
+        #=11=#
+        (2, Core.GotoNode(15))
+        #=12=#
+        (2, Expr(:(=), Core.SlotNumber(4), Expr(:the_exception)))
+        #=13=#
+        (2, Expr(:call, GlobalRef(Main, :rethrow)))
+        #=14=#
+        (2, Expr(:pop_exception, Core.SSAValue(4)))
+        #=15=#
+        (2, Expr(:leave, Core.SSAValue(2)))
+        #=16=#
+        (0, Core.GotoNode(20))
+        #=17=#
+        (0, Expr(:(=), Core.SlotNumber(5), Expr(:the_exception)))
+        #=18=#
+        (0, nothing)
+        #=19=#
+        (0, Expr(:pop_exception, Core.SSAValue(2)))
+        #=20=#
         (0, Core.ReturnNode(Core.SlotNumber(3)))
     ]
     (; handler_at, handlers) = Compiler.compute_trycatch(last.(x))
@@ -5299,26 +5323,32 @@ let
         typeof(a0),
         # TypeVar
         #=01=#
-        Bound,                  # => Integer
+        Bound,
+                          # => Integer
         #=02=#
         unbound,                # => Integer (invalid `TypeVar` widened beforehand)
         # DataType
         #=03=#
-        Type{Bound},            # => Type{Bound} where Bound<:Integer
+        Type{Bound},
+                    # => Type{Bound} where Bound<:Integer
         #=04=#
-        Type{unbound},          # => Type
+        Type{unbound},
+                  # => Type
         #=05=#
-        Vector{Bound},          # => Vector{Bound} where Bound<:Integer
+        Vector{Bound},
+                  # => Vector{Bound} where Bound<:Integer
         #=06=#
         Vector{unbound},        # => Any
         # UnionAll
         #=07=#
-        Type{<:Bound},          # => Type{<:Bound} where Bound<:Integer
+        Type{<:Bound},
+                  # => Type{<:Bound} where Bound<:Integer
         #=08=#
         Type{<:unbound},        # => Any
         # Union
         #=09=#
-        Union{Nothing,Bound},   # => Union{Nothing,Bound} where Bound<:Integer
+        Union{Nothing,Bound},
+           # => Union{Nothing,Bound} where Bound<:Integer
         #=10=#
         Union{Nothing,unbound}, # => Any
         # Vararg
@@ -6806,7 +6836,8 @@ end
 
 @eval function gen_infinite_loop_ssa()
     $(Expr(:meta, :generated, gen_infinite_loop_ssa_generator))
-    $(Expr(:meta, :generated_only)) #= no body =#
+    $(Expr(:meta, :generated_only))
+    #= no body =#
 end
 
 # We want to make sure that both this returns `Tuple` and that
diff --git a/Compiler/test/irpasses.jl b/Compiler/test/irpasses.jl
index bb3c1f9..68e57a2 100644
--- a/Compiler/test/irpasses.jl
+++ b/Compiler/test/irpasses.jl
@@ -423,7 +423,8 @@ end
 struct Point
     x::Float64
     y::Float64
-end #=@inline=#
+end
+#=@inline=#
 add(a::Point, b::Point) = Point(a.x + b.x, a.y + b.y)
 function compute_points()
     a = Point(1.5, 2.5)
@@ -751,6 +752,7 @@ let code = Any[
         # block 2
         #=  %2: =#
         Expr(:call, Core.ifelse, SSAValue(1), true, missing),
+
         #=  %3: =#
         GotoIfNot(SSAValue(2), 11),
         # block 3
@@ -763,6 +765,7 @@ let code = Any[
         # block 2
         #=  %6: =#
         nothing,
+
         #=  %7: =#
         GotoNode(8),
         # block 4
@@ -773,6 +776,7 @@ let code = Any[
         #
         #=  %9: =#
         Expr(:call, isa, SSAValue(8), Missing),
+
         #= %10: =#
         ReturnNode(SSAValue(9)),
         # block 5
@@ -1582,8 +1586,10 @@ let code = Any[
         # block 1  → 2, 3
         #=  %1: =#
         Expr(:(=), Core.SlotNumber(4), Core.Argument(2)),
+
         #=  %2: =#
         Expr(:call, :(===), Core.SlotNumber(4), nothing),
+
         #=  %3: =#
         GotoIfNot(Core.SSAValue(1), 5),
         # block 2
@@ -1592,6 +1598,7 @@ let code = Any[
         # block 3  → 4, 5
         #=  %5: =#
         Expr(:(=), Core.SlotNumber(4), false),
+
         #=  %6: =#
         GotoIfNot(Core.Argument(2), 8),
         # block 4  → 5
@@ -1914,6 +1921,7 @@ let code = Any[
         ir,
         SSAValue(5),
         Compiler.NewInstruction(Expr(:call, println, 2), Nothing, Int32(1)),
+
         #= attach_after = =#
         true,
     )
diff --git a/Compiler/test/ssair.jl b/Compiler/test/ssair.jl
index 93cc274..6388b72 100644
--- a/Compiler/test/ssair.jl
+++ b/Compiler/test/ssair.jl
@@ -670,6 +670,7 @@ let code = Any[
         # block 1
         #= %1: =#
         Expr(:boundscheck),
+
         #= %2: =#
         Compiler.GotoIfNot(SSAValue(1), 4),
         # block 2
@@ -678,6 +679,7 @@ let code = Any[
         # block 3
         #= %4: =#
         Core.PhiNode(),
+
         #= %5: =#
         Compiler.ReturnNode(),
     ]
@@ -840,7 +842,8 @@ function gen_unreachable_phinode_edge1(world::UInt, source, args...)
 end
 @eval function f_unreachable_phinode_edge1(x, y)
     $(Expr(:meta, :generated, gen_unreachable_phinode_edge1))
-    $(Expr(:meta, :generated_only)) #= no body =#
+    $(Expr(:meta, :generated_only))
+    #= no body =#
 end
 @test f_unreachable_phinode_edge1(1, 2) == 1
 
@@ -866,7 +869,8 @@ function gen_unreachable_phinode_edge2(world::UInt, source, args...)
 end
 @eval function f_unreachable_phinode_edge2(x, y)
     $(Expr(:meta, :generated, gen_unreachable_phinode_edge2))
-    $(Expr(:meta, :generated_only)) #= no body =#
+    $(Expr(:meta, :generated_only))
+    #= no body =#
 end
 @test f_unreachable_phinode_edge2(1, 2) == 2
 
@@ -892,7 +896,8 @@ function gen_must_throw_phinode_edge(world::UInt, source, _)
 end
 @eval function f_must_throw_phinode_edge()
     $(Expr(:meta, :generated, gen_must_throw_phinode_edge))
-    $(Expr(:meta, :generated_only)) #= no body =#
+    $(Expr(:meta, :generated_only))
+    #= no body =#
 end
 let ir = first(only(Base.code_ircode(f_must_throw_phinode_edge)))
     @test !any(@nospecialize(x)->isa(x, PhiNode), ir.stmts.stmt)
diff --git a/base/boot.jl b/base/boot.jl
index 18d4e60..cb461a7 100644
--- a/base/boot.jl
+++ b/base/boot.jl
@@ -404,26 +404,37 @@ macro _total_meta()
         :meta,
         Expr(
             :purity,
+
             #=:consistent=#
             true,
+
             #=:effect_free=#
             true,
+
             #=:nothrow=#
             true,
+
             #=:terminates_globally=#
             true,
+
             #=:terminates_locally=#
             false,
+
             #=:notaskstate=#
             true,
+
             #=:inaccessiblememonly=#
             true,
+
             #=:noub=#
             true,
+
             #=:noub_if_noinbounds=#
             false,
+
             #=:consistent_overlay=#
             false,
+
             #=:nortcall=#
             true,
         ),
@@ -435,26 +446,37 @@ macro _foldable_meta()
         :meta,
         Expr(
             :purity,
+
             #=:consistent=#
             true,
+
             #=:effect_free=#
             true,
+
             #=:nothrow=#
             false,
+
             #=:terminates_globally=#
             true,
+
             #=:terminates_locally=#
             false,
+
             #=:notaskstate=#
             true,
+
             #=:inaccessiblememonly=#
             true,
+
             #=:noub=#
             true,
+
             #=:noub_if_noinbounds=#
             false,
+
             #=:consistent_overlay=#
             false,
+
             #=:nortcall=#
             true,
         ),
diff --git a/base/errorshow.jl b/base/errorshow.jl
index 76014c7..95703be 100644
--- a/base/errorshow.jl
+++ b/base/errorshow.jl
@@ -735,7 +735,8 @@ end
 const BIG_STACKTRACE_SIZE = 50 # Arbitrary constant chosen here
 
 function show_reduced_backtrace(io::IO, t::Vector)
-    recorded_positions = IdDict{UInt,Vector{Int}}() #= For each frame of hash h, recorded_positions[h] is the list of indices i
+    recorded_positions = IdDict{UInt,Vector{Int}}()
+    #= For each frame of hash h, recorded_positions[h] is the list of indices i
     such that hash(t[i-1]) == h, ie the list of positions in which the
     frame appears just before. =#
 
diff --git a/base/essentials.jl b/base/essentials.jl
index 332e447..d6ed39d 100644
--- a/base/essentials.jl
+++ b/base/essentials.jl
@@ -202,26 +202,37 @@ macro _total_meta()
         :meta,
         Expr(
             :purity,
+
             #=:consistent=#
             true,
+
             #=:effect_free=#
             true,
+
             #=:nothrow=#
             true,
+
             #=:terminates_globally=#
             true,
+
             #=:terminates_locally=#
             false,
+
             #=:notaskstate=#
             true,
+
             #=:inaccessiblememonly=#
             true,
+
             #=:noub=#
             true,
+
             #=:noub_if_noinbounds=#
             false,
+
             #=:consistent_overlay=#
             false,
+
             #=:nortcall=#
             true,
         ),
@@ -233,26 +244,37 @@ macro _foldable_meta()
         :meta,
         Expr(
             :purity,
+
             #=:consistent=#
             true,
+
             #=:effect_free=#
             true,
+
             #=:nothrow=#
             false,
+
             #=:terminates_globally=#
             true,
+
             #=:terminates_locally=#
             false,
+
             #=:notaskstate=#
             true,
+
             #=:inaccessiblememonly=#
             true,
+
             #=:noub=#
             true,
+
             #=:noub_if_noinbounds=#
             false,
+
             #=:consistent_overlay=#
             false,
+
             #=:nortcall=#
             true,
         ),
@@ -264,26 +286,37 @@ macro _terminates_locally_meta()
         :meta,
         Expr(
             :purity,
+
             #=:consistent=#
             false,
+
             #=:effect_free=#
             false,
+
             #=:nothrow=#
             false,
+
             #=:terminates_globally=#
             false,
+
             #=:terminates_locally=#
             true,
+
             #=:notaskstate=#
             false,
+
             #=:inaccessiblememonly=#
             false,
+
             #=:noub=#
             false,
+
             #=:noub_if_noinbounds=#
             false,
+
             #=:consistent_overlay=#
             false,
+
             #=:nortcall=#
             false,
         ),
@@ -295,26 +328,37 @@ macro _terminates_globally_meta()
         :meta,
         Expr(
             :purity,
+
             #=:consistent=#
             false,
+
             #=:effect_free=#
             false,
+
             #=:nothrow=#
             false,
+
             #=:terminates_globally=#
             true,
+
             #=:terminates_locally=#
             true,
+
             #=:notaskstate=#
             false,
+
             #=:inaccessiblememonly=#
             false,
+
             #=:noub=#
             false,
+
             #=:noub_if_noinbounds=#
             false,
+
             #=:consistent_overlay=#
             false,
+
             #=:nortcall=#
             false,
         ),
@@ -326,26 +370,37 @@ macro _terminates_globally_notaskstate_meta()
         :meta,
         Expr(
             :purity,
+
             #=:consistent=#
             false,
+
             #=:effect_free=#
             false,
+
             #=:nothrow=#
             false,
+
             #=:terminates_globally=#
             true,
+
             #=:terminates_locally=#
             true,
+
             #=:notaskstate=#
             true,
+
             #=:inaccessiblememonly=#
             false,
+
             #=:noub=#
             false,
+
             #=:noub_if_noinbounds=#
             false,
+
             #=:consistent_overlay=#
             false,
+
             #=:nortcall=#
             false,
         ),
@@ -357,26 +412,37 @@ macro _terminates_globally_noub_meta()
         :meta,
         Expr(
             :purity,
+
             #=:consistent=#
             false,
+
             #=:effect_free=#
             false,
+
             #=:nothrow=#
             false,
+
             #=:terminates_globally=#
             true,
+
             #=:terminates_locally=#
             true,
+
             #=:notaskstate=#
             false,
+
             #=:inaccessiblememonly=#
             false,
+
             #=:noub=#
             true,
+
             #=:noub_if_noinbounds=#
             false,
+
             #=:consistent_overlay=#
             false,
+
             #=:nortcall=#
             false,
         ),
@@ -388,26 +454,37 @@ macro _effect_free_terminates_locally_meta()
         :meta,
         Expr(
             :purity,
+
             #=:consistent=#
             false,
+
             #=:effect_free=#
             true,
+
             #=:nothrow=#
             false,
+
             #=:terminates_globally=#
             false,
+
             #=:terminates_locally=#
             true,
+
             #=:notaskstate=#
             false,
+
             #=:inaccessiblememonly=#
             false,
+
             #=:noub=#
             false,
+
             #=:noub_if_noinbounds=#
             false,
+
             #=:consistent_overlay=#
             false,
+
             #=:nortcall=#
             false,
         ),
@@ -419,26 +496,37 @@ macro _nothrow_noub_meta()
         :meta,
         Expr(
             :purity,
+
             #=:consistent=#
             false,
+
             #=:effect_free=#
             false,
+
             #=:nothrow=#
             true,
+
             #=:terminates_globally=#
             false,
+
             #=:terminates_locally=#
             false,
+
             #=:notaskstate=#
             false,
+
             #=:inaccessiblememonly=#
             false,
+
             #=:noub=#
             true,
+
             #=:noub_if_noinbounds=#
             false,
+
             #=:consistent_overlay=#
             false,
+
             #=:nortcall=#
             false,
         ),
@@ -450,26 +538,37 @@ macro _nothrow_meta()
         :meta,
         Expr(
             :purity,
+
             #=:consistent=#
             false,
+
             #=:effect_free=#
             false,
+
             #=:nothrow=#
             true,
+
             #=:terminates_globally=#
             false,
+
             #=:terminates_locally=#
             false,
+
             #=:notaskstate=#
             false,
+
             #=:inaccessiblememonly=#
             false,
+
             #=:noub=#
             false,
+
             #=:noub_if_noinbounds=#
             false,
+
             #=:consistent_overlay=#
             false,
+
             #=:nortcall=#
             false,
         ),
@@ -481,26 +580,37 @@ macro _noub_meta()
         :meta,
         Expr(
             :purity,
+
             #=:consistent=#
             false,
+
             #=:effect_free=#
             false,
+
             #=:nothrow=#
             false,
+
             #=:terminates_globally=#
             false,
+
             #=:terminates_locally=#
             false,
+
             #=:notaskstate=#
             false,
+
             #=:inaccessiblememonly=#
             false,
+
             #=:noub=#
             true,
+
             #=:noub_if_noinbounds=#
             false,
+
             #=:consistent_overlay=#
             false,
+
             #=:nortcall=#
             false,
         ),
@@ -512,26 +622,37 @@ macro _notaskstate_meta()
         :meta,
         Expr(
             :purity,
+
             #=:consistent=#
             false,
+
             #=:effect_free=#
             false,
+
             #=:nothrow=#
             false,
+
             #=:terminates_globally=#
             false,
+
             #=:terminates_locally=#
             false,
+
             #=:notaskstate=#
             true,
+
             #=:inaccessiblememonly=#
             false,
+
             #=:noub=#
             false,
+
             #=:noub_if_noinbounds=#
             false,
+
             #=:consistent_overlay=#
             false,
+
             #=:nortcall=#
             false,
         ),
@@ -543,26 +664,37 @@ macro _noub_if_noinbounds_meta()
         :meta,
         Expr(
             :purity,
+
             #=:consistent=#
             false,
+
             #=:effect_free=#
             false,
+
             #=:nothrow=#
             false,
+
             #=:terminates_globally=#
             false,
+
             #=:terminates_locally=#
             false,
+
             #=:notaskstate=#
             false,
+
             #=:inaccessiblememonly=#
             false,
+
             #=:noub=#
             false,
+
             #=:noub_if_noinbounds=#
             true,
+
             #=:consistent_overlay=#
             false,
+
             #=:nortcall=#
             false,
         ),
diff --git a/base/toml_parser.jl b/base/toml_parser.jl
index e14a6eb..86c616d 100644
--- a/base/toml_parser.jl
+++ b/base/toml_parser.jl
@@ -1233,7 +1233,8 @@ function parse_string_continue(l::Parser, multiline::Bool, quoted::Bool)::Err{St
                     if !accept_n(l, n, isvalid_hex)
                         return ParserError(ErrInvalidUnicodeScalar)
                     end
-                    codepoint = parse_int(l, false, 16)::Int64 #=
+                    codepoint = parse_int(l, false, 16)::Int64
+                    #=
                     Unicode Scalar Value
                     ---------------------
                     Any Unicode code point except high-surrogate and
diff --git a/stdlib/REPL/src/LineEdit.jl b/stdlib/REPL/src/LineEdit.jl
index 4b41592..ba02947 100644
--- a/stdlib/REPL/src/LineEdit.jl
+++ b/stdlib/REPL/src/LineEdit.jl
@@ -3158,6 +3158,7 @@ init_state(terminal, prompt::Prompt) = PromptState(
     IOBuffer[],
     1,
     InputAreaState(1, 1),
+
     #=indent(spaces)=#
     -1,
     Threads.SpinLock(),
diff --git a/stdlib/REPL/src/REPLCompletions.jl b/stdlib/REPL/src/REPLCompletions.jl
index 36ed5bb..4c61b2c 100644
--- a/stdlib/REPL/src/REPLCompletions.jl
+++ b/stdlib/REPL/src/REPLCompletions.jl
@@ -748,14 +748,19 @@ end
 
 function resolve_toplevel_symbols!(src::Core.CodeInfo, mod::Module)
     @ccall jl_resolve_definition_effects_in_ir(
+
         #=jl_array_t *stmts=#
         src.code::Any,
+
         #=jl_module_t *m=#
         mod::Any,
+
         #=jl_svec_t *sparam_vals=#
         Core.svec()::Any,
+
         #=jl_value_t *binding_edge=#
         C_NULL::Ptr{Cvoid},
+
         #=int binding_effects=#
         0::Int,
     )::Cvoid
@@ -1026,6 +1031,7 @@ function complete_methods!(
         nothing,
         max_method_completions,
         Base.get_world_counter(),
+
         #=ambig=#
         true,
         Ref(typemin(UInt)),
diff --git a/stdlib/Random/src/Random.jl b/stdlib/Random/src/Random.jl
index 85ad43c..062b41a 100644
--- a/stdlib/Random/src/Random.jl
+++ b/stdlib/Random/src/Random.jl
@@ -477,7 +477,8 @@ julia> rand(Xoshiro(), Bool) # not reproducible either
 true
 ```
 """
-seed!(rng::AbstractRNG) = seed!(rng, nothing) #=
+seed!(rng::AbstractRNG) = seed!(rng, nothing)
+#=
 We have this generic definition instead of the alternative option
 `seed!(rng::AbstractRNG, ::Nothing) = seed!(rng)`
 because it would lead too easily to ambiguities, e.g. when we define `seed!(::Xoshiro, seed)`.
diff --git a/test/core.jl b/test/core.jl
index 6cf758c..6024845 100644
--- a/test/core.jl
+++ b/test/core.jl
@@ -9683,7 +9683,8 @@ end
 
 struct UnionField6
     alignment::Int32
-    padding::NTuple{3,UInt8} #= implicit-padding::UInt8 =#
+    padding::NTuple{3,UInt8}
+    #= implicit-padding::UInt8 =#
     maybe_val::Union{UInt16,Nothing} # offset = 8, align = 8, size = 2
 end
 @test UnionField6(1, (1, 1, 1), 2018).maybe_val == 2018
diff --git a/test/reflection.jl b/test/reflection.jl
index ccf4ff9..855046a 100644
--- a/test/reflection.jl
+++ b/test/reflection.jl
@@ -1112,12 +1112,14 @@ _test_at_locals2(1, 1, 0.5f0)
     _dump_function(
         f31687_parent,
         Tuple{},
+
         #=native=#
         false,
         #=wrapper=#
         false,
         #=raw=#
         true,
+
         #=dump_module=#
         true,
         #=syntax=#
@@ -1125,6 +1127,7 @@ _test_at_locals2(1, 1, 0.5f0)
         #=optimize=#
         false,
         :none,
+
         #=binary=#
         false,
     )
diff --git a/test/syntax.jl b/test/syntax.jl
index 2ae6921..5f26af6 100644
--- a/test/syntax.jl
+++ b/test/syntax.jl
@@ -601,7 +601,8 @@ end
 @test Meta.lower(Main, Meta.parse("let
               global x = 2
               local x = 1
-              end")) == Expr(:error, "variable \"x\" declared both local and global") #=
+              end")) == Expr(:error, "variable \"x\" declared both local and global")
+#=
 @test Meta.lower(Main, Meta.parse("let
               local x = 2
               local x = 1
diff --git a/test/testhelpers/OffsetArrays.jl b/test/testhelpers/OffsetArrays.jl
index d25e7bd..758b478 100644
--- a/test/testhelpers/OffsetArrays.jl
+++ b/test/testhelpers/OffsetArrays.jl
@@ -136,7 +136,8 @@ offset_coerce(::Type{I}, r::AbstractUnitRange) where {I<:AbstractUnitRange} =
 @inline Base.axes1(r::IdOffsetRange) = IdOffsetRange(Base.axes1(r.parent), r.offset)
 @inline Base.unsafe_indices(r::IdOffsetRange) = (Base.axes1(r),)
 @inline Base.length(r::IdOffsetRange) = length(r.parent)
-@inline Base.isempty(r::IdOffsetRange) = isempty(r.parent) #= We specialize on reduced_indices to work around cases where the parent axis type doesn't
+@inline Base.isempty(r::IdOffsetRange) = isempty(r.parent)
+#= We specialize on reduced_indices to work around cases where the parent axis type doesn't
 support reduced_index, but the axes do support reduced_indices
 The difference is that reduced_index expects the axis type to remain unchanged,
 which may not always be possible, eg. for statically sized axes

@penelopeysm

Copy link
Copy Markdown
Member Author

Gah.

@penelopeysm

Copy link
Copy Markdown
Member Author

!formatbot JuliaLang/julia@v1.12.6 v2_stable_multiline_strings=true

@github-actions

Copy link
Copy Markdown
Contributor

FormatBot Results

Description Value
FormatBot workflow run workflow run
Target repo JuliaLang/julia@v1.12.6
JuliaFormatter base 24c872c
JuliaFormatter PR 5ded87f
Options v2_stable_multiline_strings=true
Diff (7008 bytes)
diff --git a/Compiler/test/inference.jl b/Compiler/test/inference.jl
index 37707ac..2403777 100644
--- a/Compiler/test/inference.jl
+++ b/Compiler/test/inference.jl
@@ -2416,7 +2416,8 @@ end
             Core.svec(:X, :Y),
             false,
         ))
-        $(Expr(:meta, :generated_only)) #= no body =#
+        $(Expr(:meta, :generated_only))
+        #= no body =#
     end
 end
 
@@ -2428,15 +2429,18 @@ end
             Core.svec(:X, :Y),
             true,
         ))
-        $(Expr(:meta, :generated_only)) #= no body =#
+        $(Expr(:meta, :generated_only))
+        #= no body =#
     end
     function f24852_early_inflated(f, x::X, y::Y) where {X,Y}
         $(Expr(:meta, :generated, f24852_gen_cinfo_inflated))
-        $(Expr(:meta, :generated_only)) #= no body =#
+        $(Expr(:meta, :generated_only))
+        #= no body =#
     end
     function f24852_early_uninflated(f, x::X, y::Y) where {X,Y}
         $(Expr(:meta, :generated, f24852_gen_cinfo_uninflated))
-        $(Expr(:meta, :generated_only)) #= no body =#
+        $(Expr(:meta, :generated_only))
+        #= no body =#
     end
 end
 
@@ -6806,7 +6810,8 @@ end
 
 @eval function gen_infinite_loop_ssa()
     $(Expr(:meta, :generated, gen_infinite_loop_ssa_generator))
-    $(Expr(:meta, :generated_only)) #= no body =#
+    $(Expr(:meta, :generated_only))
+    #= no body =#
 end
 
 # We want to make sure that both this returns `Tuple` and that
diff --git a/Compiler/test/irpasses.jl b/Compiler/test/irpasses.jl
index bb3c1f9..2edb908 100644
--- a/Compiler/test/irpasses.jl
+++ b/Compiler/test/irpasses.jl
@@ -423,7 +423,8 @@ end
 struct Point
     x::Float64
     y::Float64
-end #=@inline=#
+end
+#=@inline=#
 add(a::Point, b::Point) = Point(a.x + b.x, a.y + b.y)
 function compute_points()
     a = Point(1.5, 2.5)
diff --git a/Compiler/test/ssair.jl b/Compiler/test/ssair.jl
index 93cc274..218baf0 100644
--- a/Compiler/test/ssair.jl
+++ b/Compiler/test/ssair.jl
@@ -840,7 +840,8 @@ function gen_unreachable_phinode_edge1(world::UInt, source, args...)
 end
 @eval function f_unreachable_phinode_edge1(x, y)
     $(Expr(:meta, :generated, gen_unreachable_phinode_edge1))
-    $(Expr(:meta, :generated_only)) #= no body =#
+    $(Expr(:meta, :generated_only))
+    #= no body =#
 end
 @test f_unreachable_phinode_edge1(1, 2) == 1
 
@@ -866,7 +867,8 @@ function gen_unreachable_phinode_edge2(world::UInt, source, args...)
 end
 @eval function f_unreachable_phinode_edge2(x, y)
     $(Expr(:meta, :generated, gen_unreachable_phinode_edge2))
-    $(Expr(:meta, :generated_only)) #= no body =#
+    $(Expr(:meta, :generated_only))
+    #= no body =#
 end
 @test f_unreachable_phinode_edge2(1, 2) == 2
 
@@ -892,7 +894,8 @@ function gen_must_throw_phinode_edge(world::UInt, source, _)
 end
 @eval function f_must_throw_phinode_edge()
     $(Expr(:meta, :generated, gen_must_throw_phinode_edge))
-    $(Expr(:meta, :generated_only)) #= no body =#
+    $(Expr(:meta, :generated_only))
+    #= no body =#
 end
 let ir = first(only(Base.code_ircode(f_must_throw_phinode_edge)))
     @test !any(@nospecialize(x)->isa(x, PhiNode), ir.stmts.stmt)
diff --git a/base/errorshow.jl b/base/errorshow.jl
index 76014c7..95703be 100644
--- a/base/errorshow.jl
+++ b/base/errorshow.jl
@@ -735,7 +735,8 @@ end
 const BIG_STACKTRACE_SIZE = 50 # Arbitrary constant chosen here
 
 function show_reduced_backtrace(io::IO, t::Vector)
-    recorded_positions = IdDict{UInt,Vector{Int}}() #= For each frame of hash h, recorded_positions[h] is the list of indices i
+    recorded_positions = IdDict{UInt,Vector{Int}}()
+    #= For each frame of hash h, recorded_positions[h] is the list of indices i
     such that hash(t[i-1]) == h, ie the list of positions in which the
     frame appears just before. =#
 
diff --git a/base/toml_parser.jl b/base/toml_parser.jl
index e14a6eb..86c616d 100644
--- a/base/toml_parser.jl
+++ b/base/toml_parser.jl
@@ -1233,7 +1233,8 @@ function parse_string_continue(l::Parser, multiline::Bool, quoted::Bool)::Err{St
                     if !accept_n(l, n, isvalid_hex)
                         return ParserError(ErrInvalidUnicodeScalar)
                     end
-                    codepoint = parse_int(l, false, 16)::Int64 #=
+                    codepoint = parse_int(l, false, 16)::Int64
+                    #=
                     Unicode Scalar Value
                     ---------------------
                     Any Unicode code point except high-surrogate and
diff --git a/stdlib/Random/src/Random.jl b/stdlib/Random/src/Random.jl
index 85ad43c..062b41a 100644
--- a/stdlib/Random/src/Random.jl
+++ b/stdlib/Random/src/Random.jl
@@ -477,7 +477,8 @@ julia> rand(Xoshiro(), Bool) # not reproducible either
 true
 ```
 """
-seed!(rng::AbstractRNG) = seed!(rng, nothing) #=
+seed!(rng::AbstractRNG) = seed!(rng, nothing)
+#=
 We have this generic definition instead of the alternative option
 `seed!(rng::AbstractRNG, ::Nothing) = seed!(rng)`
 because it would lead too easily to ambiguities, e.g. when we define `seed!(::Xoshiro, seed)`.
diff --git a/test/core.jl b/test/core.jl
index 6cf758c..6024845 100644
--- a/test/core.jl
+++ b/test/core.jl
@@ -9683,7 +9683,8 @@ end
 
 struct UnionField6
     alignment::Int32
-    padding::NTuple{3,UInt8} #= implicit-padding::UInt8 =#
+    padding::NTuple{3,UInt8}
+    #= implicit-padding::UInt8 =#
     maybe_val::Union{UInt16,Nothing} # offset = 8, align = 8, size = 2
 end
 @test UnionField6(1, (1, 1, 1), 2018).maybe_val == 2018
diff --git a/test/syntax.jl b/test/syntax.jl
index 2ae6921..5f26af6 100644
--- a/test/syntax.jl
+++ b/test/syntax.jl
@@ -601,7 +601,8 @@ end
 @test Meta.lower(Main, Meta.parse("let
               global x = 2
               local x = 1
-              end")) == Expr(:error, "variable \"x\" declared both local and global") #=
+              end")) == Expr(:error, "variable \"x\" declared both local and global")
+#=
 @test Meta.lower(Main, Meta.parse("let
               local x = 2
               local x = 1
diff --git a/test/testhelpers/OffsetArrays.jl b/test/testhelpers/OffsetArrays.jl
index d25e7bd..758b478 100644
--- a/test/testhelpers/OffsetArrays.jl
+++ b/test/testhelpers/OffsetArrays.jl
@@ -136,7 +136,8 @@ offset_coerce(::Type{I}, r::AbstractUnitRange) where {I<:AbstractUnitRange} =
 @inline Base.axes1(r::IdOffsetRange) = IdOffsetRange(Base.axes1(r.parent), r.offset)
 @inline Base.unsafe_indices(r::IdOffsetRange) = (Base.axes1(r),)
 @inline Base.length(r::IdOffsetRange) = length(r.parent)
-@inline Base.isempty(r::IdOffsetRange) = isempty(r.parent) #= We specialize on reduced_indices to work around cases where the parent axis type doesn't
+@inline Base.isempty(r::IdOffsetRange) = isempty(r.parent)
+#= We specialize on reduced_indices to work around cases where the parent axis type doesn't
 support reduced_index, but the axes do support reduced_indices
 The difference is that reduced_index expects the axis type to remain unchanged,
 which may not always be possible, eg. for statically sized axes

@penelopeysm
penelopeysm merged commit c8c21f5 into master Jun 27, 2026
21 checks passed
@penelopeysm
penelopeysm deleted the comm branch June 27, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multi-line comments are merged into previous line

1 participant