Skip to content

Newline after multiline arguments? #209

@krlmlr

Description

@krlmlr

This looks fairly awkward to me:

styler::style_text("
list(
  c(
    a
  ), c(
    b
  )
)
")
#> list(
#>   c(
#>     a
#>   ), c(
#>     b
#>   )
#> )

Created on 2023-06-15 with reprex v2.0.2

I think there should be a newline after ), . Is there a rule in the style guide? Should there be one?

@MichaelChirico suggests that enforcing the newline creates wasted space. While true, I also find the comma between ) and c( difficult to spot, and I'm happy to trade the extra lines for readability here.

Downstream: r-lib/styler#1133 (which also suggests to discuss here first).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions