Skip to content

add curly braces to if-else #201

Closed
Closed

Description

@lorenzwalthert

If an if-else statement spans over mutliple lines, add curly braces, so

#> {
#>   if (TRUE)
#>     1
#>   else
#>     2
#> }

Should be

#> {
#>   if (TRUE) {
#>     1
#>   } else {
#>     2
#>   }
#> }

Follow-up of #191.

Activity

  1. lorenzwalthert commented on Sep 18, 2017

    @lorenzwalthert
    CollaboratorAuthor

    @krlmlr Should that be a strict = TRUE transformation?

  2. krlmlr commented on Sep 18, 2017

    @krlmlr
    Member

    Currently we have both strict = TRUE and scope = "token", which is a bit confusing. I think this definitely belongs in the "token" scope, not sure about strictness.

  3. lorenzwalthert commented on Sep 18, 2017

    @lorenzwalthert
    CollaboratorAuthor

    Ok, let it be a strict = TRUE transformation since I think it can be legit to write:

    if (also_quite_long(call(a, lazy(other(call)))
      return(very_long(call(1+1, another, long, agrument)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions