Skip to content

Unnecessary brackets inside substitute expressions #889

@kpagacz

Description

@kpagacz

This PR #876 supposedly fixes the issue of styler putting additional, unnecessary brackets inside substitute expressions. But having installed the latest version of styler from main, I am still experiencing the issue described in #873

Here is my reprex:

library(magrittr)
expr <- substitute(
  expr = {
    iris %>%
      exprA %>%
      exprB
  },
  env = list(exprA = call("summary"), exprB = call("print"))
)

Styler styles it to:

library(magrittr)
expr <- substitute(
  expr = {
    iris %>%
      exprA() %>%
      exprB()
  },
  env = list(exprA = call("summary"), exprB = call("print"))
)

Here's my sessionInfo:
image

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