Skip to content

Large array literal split into one line per element #563

Description

@williamfgc

Large array literals (hardcoded values in code):

mats[1:34,1] = Int32[ 58, 59, 60, 61, 40, 42, 43, 44, 45, 46,  1,  2,  3,  7, 8,  9, 10, 29, 57, 47, 48,  0, 62 ]

are formatted as:

mats[1:34, 1] = Int32[
        58,
        59,
        60,
        61,
        ....

reducing readability and increasing the number of lines of code linearly.

Not sure if this is a feature of a bug. This is reproducible in VSCode and from the REPL with Julia v1.7 and JuliaFormatter v0.22.7 .
For now I'm just disabling formatting with #! format: off and #! format: on. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions