Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect formatting of closing braces with pipe #1202

Open
IndrajeetPatil opened this issue May 11, 2024 · 1 comment
Open

Incorrect formatting of closing braces with pipe #1202

IndrajeetPatil opened this issue May 11, 2024 · 1 comment

Comments

@IndrajeetPatil
Copy link
Collaborator

Observed

styler::style_text(text = '(
1:4 %>% {
  (
    . + 1
  )
}
)')
#> (
#>   1:4 %>%
#>     {
#>       (
#>         . + 1
#>       )
#>     })

Created on 2024-05-11 with reprex v2.1.0

Session info
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.4.0 (2024-04-24)
#>  os       macOS Sonoma 14.4.1
#>  system   aarch64, darwin20
#>  ui       X11
#>  language (EN)
#>  collate  en_US.UTF-8
#>  ctype    en_US.UTF-8
#>  tz       Europe/Berlin
#>  date     2024-05-11
#>  pandoc   3.1.13 @ /usr/local/bin/ (via rmarkdown)
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version     date (UTC) lib source
#>  cli           3.6.2       2023-12-11 [1] CRAN (R 4.4.0)
#>  crayon        1.5.2       2022-09-29 [1] CRAN (R 4.4.0)
#>  digest        0.6.35      2024-03-11 [1] CRAN (R 4.4.0)
#>  evaluate      0.23        2023-11-01 [1] CRAN (R 4.4.0)
#>  fastmap       1.1.1       2023-02-24 [1] CRAN (R 4.4.0)
#>  fs            1.6.4.9000  2024-05-05 [1] local
#>  glue          1.7.0       2024-01-09 [1] RSPM
#>  htmltools     0.5.8.1     2024-04-04 [1] CRAN (R 4.4.0)
#>  knitr         1.46        2024-04-06 [1] CRAN (R 4.4.0)
#>  lifecycle     1.0.4       2023-11-07 [1] CRAN (R 4.4.0)
#>  magrittr      2.0.3       2022-03-30 [1] CRAN (R 4.4.0)
#>  prettycode    1.1.0       2019-12-16 [1] RSPM (R 4.4.0)
#>  purrr         1.0.2       2023-08-10 [1] RSPM
#>  R.cache       0.16.0      2022-07-21 [1] CRAN (R 4.4.0)
#>  R.methodsS3   1.8.2       2022-06-13 [1] CRAN (R 4.4.0)
#>  R.oo          1.26.0      2024-01-24 [1] CRAN (R 4.4.0)
#>  R.utils       2.12.3      2023-11-18 [1] CRAN (R 4.4.0)
#>  reprex        2.1.0       2024-01-11 [1] CRAN (R 4.4.0)
#>  rlang         1.1.3       2024-01-10 [1] CRAN (R 4.4.0)
#>  rmarkdown     2.26        2024-03-05 [1] RSPM
#>  rstudioapi    0.16.0      2024-03-24 [1] CRAN (R 4.4.0)
#>  sessioninfo   1.2.2       2021-12-06 [1] RSPM
#>  styler        1.10.3.9000 2024-05-11 [1] local
#>  vctrs         0.6.5       2023-12-01 [1] RSPM
#>  withr         3.0.0       2024-01-16 [1] RSPM
#>  xfun          0.43        2024-03-25 [1] CRAN (R 4.4.0)
#>  yaml          2.3.8       2023-12-11 [1] CRAN (R 4.4.0)
#> 
#>  [1] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library
#> 
#> ──────────────────────────────────────────────────────────────────────────────

Expected

#> (
#>   1:4 %>%
#>     {
#>       (
#>         . + 1
#>       )
#>     }
#> )
@lorenzwalthert
Copy link
Collaborator

I agree.

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

No branches or pull requests

2 participants