Skip to content

separate_kwargs_with_semicolon renders code invalid for specific input code #854

Open
@sstroemer

Description

Given the following (full) .JuliaFormatter.toml

always_for_in = true
always_use_return = true
margin = 120
remove_extra_newlines = true
separate_kwargs_with_semicolon = true
short_to_long_function_def = false
whitespace_typedefs = true
whitespace_in_kwargs = false
whitespace_ops_in_indices = true

and the code line

plot(df, kind="bar", x=:time, y=:value, color=:asset, Layout(title="Title", barmode="relative"))

running format(...) on this, formats it into

plot(df; kind="bar", x=:time, y=:value, color=:asset, Layout(; title="Title", barmode="relative"))

which produces the following error

ERROR: syntax: invalid keyword argument syntax "Layout(; title = "Title", barmode = "relative")" around /home/user/file.jl:1

While one may argue about how the original code is given, it is a direct example code from plotly.com/julia/bar-charts/, and working Julia code, so it should not be broken by any kind of configuration.

See also:

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions