Skip to content

Fix SciMLStyle regressions#979

Closed
svchb wants to merge 39 commits into
JuliaEditorSupport:masterfrom
svchb:jf_reg1
Closed

Fix SciMLStyle regressions#979
svchb wants to merge 39 commits into
JuliaEditorSupport:masterfrom
svchb:jf_reg1

Conversation

@svchb
Copy link
Copy Markdown
Contributor

@svchb svchb commented May 5, 2026

Based on #978

Regressions fixed

Indexed assignment LHS splitting

Fixed indexed assignment targets being split even when the full index expression fits on one line.

Before:

cache_table[key,
            slot] = source_table[key, slot] + step * delta_table[key, slot]

After:

cache_table[key, slot] = source_table[key, slot] +
                         step * delta_table[key, slot]

Pair RHS call forced onto a new line
Fixed pair entries where the => RHS call was moved to a new continuation line unnecessarily.

Before:

"Hash table implementation notes" =>
    joinpath("src",
             "hash_table.md")

After:

"Hash table implementation notes" => joinpath("src",
                                              "hash_table.md")

Multiline typed pair vectors collapsed
Fixed multiline typed pair-vector literals being collapsed into a single long line.

Before:

metadata = Pair{String, Any}["Start vertex" => first(graph.vertices), "Final vertex" => last(graph.vertices), "search algorithm" => traversal.algorithm |> typeof |> nameof, "directed" => graph.is_directed]

After:

metadata = Pair{String, Any}["Start vertex" => first(graph.vertices),
                             "Final vertex" => last(graph.vertices),
                             "search algorithm" => traversal.algorithm |> typeof |> nameof,
                             "directed" => graph.is_directed]

Tuple bindings in threaded for headers
Fixed tuple bindings in for headers being split across lines even when they fit.

Before:

@threaded destination.scheduler for (dest_id,
                                     src_id) in zip(eachindex(destination),
                                                    eachindex(source))

After:

@threaded destination.scheduler for (dest_id, src_id) in zip(eachindex(destination),
                                                             eachindex(source))

Multiline do block arguments
Fixed calls with keyword arguments followed by do blocks where the closing parenthesis was moved to its own line and do arguments were realigned incorrectly.

Before:

foreach_neighbor(points, points, index;
                 backend=SerialBackend()
                 ) do item, neighbor,
                      _, _

After:

foreach_neighbor(points, points, index;
                 backend=SerialBackend()) do item, neighbor,
                                             _, _

Dict entries with tuple RHS values
Fixed Dict(...) entries with tuple RHS values so pair arrows align consistently and RHS tuple contents remain in SciML-style layout.

Before:

algorithm_cases = Dict(
    "default search" => (),
    "with static scheduler" =>
        (backend=StaticBackend(),),
    "with damping source term" =>
        (source_terms=DampingTerm(coefficient=1e-4),),
)

After:

algorithm_cases = Dict(
    "default search"           => (),
    "with static scheduler"    => (backend=StaticBackend(),),
    "with damping source term" => (source_terms=DampingTerm(coefficient=1e-4),),
)

Comments inside multiline tuple RHS values
Fixed comments inside multiline tuple RHS values being shifted left after formatting.

Before:

"with weighted viscosity" => (
 # from 0.02*10.0*1.2*0.05/8
                              viscosity_model=WeightedViscosity(nu=0.0015),)

After:

"with weighted viscosity" => (
                                # from 0.02*10.0*1.2*0.05/8
                                viscosity_model=WeightedViscosity(nu=0.0015),)

Short binary expressions inside tuple RHS values
Fixed short RHS expressions staying split even though the flattened expression fits within the SciML margin.

Before:

"with spline kernel" => (smoothing_length=1.1 *
                                           item_spacing,
                         smoothing_kernel=SplineKernel{2}())

After:

"with spline kernel" => (smoothing_length=1.1 * item_spacing,
                         smoothing_kernel=SplineKernel{2}())

@svchb svchb marked this pull request as draft May 5, 2026 12:04
@svchb svchb changed the title Fix SciMLStyle split indexed assignment LHS formatting Fix SciMLStyle regressions May 5, 2026
@svchb svchb marked this pull request as ready for review May 5, 2026 13:48
@penelopeysm
Copy link
Copy Markdown
Member

This is a nice combo of changes -- but would it be possible to have separate PRs for each fix individually?

@svchb
Copy link
Copy Markdown
Contributor Author

svchb commented May 28, 2026

split into multiple prs #997, #998, #999, #1000, #1001

@svchb svchb closed this May 28, 2026
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.

2 participants