Skip to content

{ gets bumped in compound while statement --> open curly violation #966

@MichaelChirico

Description

@MichaelChirico
styler::style_text('
while ({
  bad <- grepl("_", z)
  any(bad)
}) {
  TRUE
}
')
# while (
#   {
#     bad <- grepl("_", z)
#     any(bad)
#   })
# {
#   TRUE
# }

The { is bumped but the style rules dictate { should be on the line with ):

{ should be the last character on the line. Related code (e.g., an if clause, a function declaration, a trailing comma, …) must be on the same line as the opening brace.

AFAIK clauses like ({ ... }) are generally fine, so I'm also not sure why ( and { were separated...

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