Skip to content

Wrong indention of else if braces are missing #191

Closed

Description

@krlmlr
styler::style_text("{if (TRUE)\n1\nelse\n2\n}")
#> {
#>   if (TRUE)
#>     1
#>     else
#>     2
#> }

Can we add braces around both the if and else parts here?

Activity

  1. lorenzwalthert commented on Sep 16, 2017

    @lorenzwalthert
    Collaborator

    Right... So I suggest to first fix the indention and later consider adding braces. If I recall correctly, the tidyverse style guide allows to drop curly braces if the statement fits on one line so I think ultimatively adding braces is the goal.

  2. lorenzwalthert commented on Sep 16, 2017

    @lorenzwalthert
    Collaborator

    Depends on #128 in R/unindent.R.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions