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

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

Closed
MichaelChirico opened this issue Mar 13, 2022 · 2 comments

Comments

@MichaelChirico
Copy link
Collaborator

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

@MichaelChirico MichaelChirico changed the title infix_spaces_linter should include tilde / formula operator infix_spaces_linter should include tilde / formula operator and = in function definitions Mar 13, 2022
@MichaelChirico
Copy link
Collaborator Author

lintr also misses = used in function definitions:

lintr::lint("foo <- function(a=1, b=2) { }\n", lintr::infix_spaces_linter())

@MichaelChirico
Copy link
Collaborator Author

This was handled in #931

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

No branches or pull requests

1 participant