Repository navigation
added assignment_spaces lintr - #538
Conversation
|
Thanks for taking the time to make a Pull Request :) |
|
I added all negative test cases and simplified the regex. Couldn't think of a case where it would be a false positive, is there? |
|
The simplified regex looks like there will be a false positive for indented code. if (0 < 1) {
x <- 42L
}as a test case (no lints expected, if I understand your intentions) Also, bad variable names might confuse the linter, such as
By the way: Your teammates code is okay with the tidyverse style guide |
|
Thanks for that edge case, you're right. What do you think about my new check? Yeah, thats why I didn't add it to the default cases, but we want everyone in the team to use the same style. |
|
I was thinking more like expect_lint("\"my = variable\" <- 42.0", NULL, assignment_spaces) |
We have a former SPS programmer in our team, who likes to define variables like this:

He doesn't notice all the time so I created this check. I didn't add it to the default_linters.
Let me know if I can improve anything.