Skip to content

styler does not remove space after $ #1245

@stibu81

Description

@stibu81

styler removes spaces before $ but not after:

library(styler)

# OK
style_text("mtcars $disp")
#> mtcars$disp

# Not OK
style_text("mtcars$ disp")
#> mtcars$ disp
style_text("mtcars $ disp")
#> mtcars$ disp

Created on 2024-12-06 with reprex v2.1.1

According to section 2.2.4 of the tidyverse style guide, $ "should never be surrounded by spaces":

There are a few exceptions, which should never be surrounded by spaces:

  • The operators with high precedence: ::, :::, $, @, [, [[, ^, unary -, unary +, and :.

I used styler 1.10.3.9000, 2f1cc9b.

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