Skip to content

infix_spaces_linter should include tilde / formula operator and = in function definitions #930

Closed

Description

@MichaelChirico

It's covered by {styler}:

styler::style_text("a~b")
# a ~ b

But not infix_spaces_linter():

lintr::lint("a~b\n", infix_spaces_linter())

This is called out by omission in the style guide, which talks about one-sided formulas:

https://style.tidyverse.org/syntax.html#infix-operators

Activity

  1. changed the title [-]infix_spaces_linter should include tilde / formula operator[/-] [+]infix_spaces_linter should include tilde / formula operator and = in function definitions[/+] on Mar 13, 2022
  2. MichaelChirico commented on Mar 13, 2022

    @MichaelChirico
    CollaboratorAuthor

    lintr also misses = used in function definitions:

    lintr::lint("foo <- function(a=1, b=2) { }\n", lintr::infix_spaces_linter())
    
  3. MichaelChirico commented on Mar 22, 2022

    @MichaelChirico
    CollaboratorAuthor

    This was handled in #931

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

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