Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

separate_kwargs_with_semicolon renders code invalid for specific input code #854

Open
sstroemer opened this issue Jun 29, 2024 · 2 comments

Comments

@sstroemer
Copy link

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:

@domluna
Copy link
Owner

domluna commented Jul 18, 2024

@domluna
Copy link
Owner

domluna commented Jul 18, 2024

you can set this to false in the interim separate_kwargs_with_semicolon = false

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

No branches or pull requests

2 participants