Skip to content

when convert shortcutting || that are over length into if statement #443

Open
@oxinabox

Description

right now (at least with the BlueStyle() setting)
JuliaFormatter will change

    size(dx) == map(length, project.axes) || throw(_projection_mismatch(project.axes, size(dx)))

into

    size(dx) == map(length, project.axes) ||
        throw(_projection_mismatch(project.axes, size(dx)))

It would be nicer to change it into:

    if size(dx) != map(length, project.axes)
        throw(_projection_mismatch(project.axes, size(dx)))
    end

Since the virtue of using shortcutting || is that it is compact.
But if multilining already, might as well be explict.
BlueStyle itself has no explict opinion on this

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions