-
Notifications
You must be signed in to change notification settings - Fork 187
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
"((" is a left paren space violation? #259
Comments
Such a hilarious runaround: lint("generate.R") ## generate.R:289:10: style: Place a space before left parenthesis, except in a function call.
## while ((out <- stri_rand_strings(1, n)) %in% exclude){
## ^ After adding a space: lint("generate.R") ## generate.R:289:10: style: Do not place spaces around code in parentheses or square brackets.
## while ( (out <- stri_rand_strings(1, n)) %in% exclude){
## ^ Patching my use case with |
@wlandau I've run into that exact issue several times, leading me just not to do left parentheses linting. |
@peterhurford I run into the same issue, Have you added not_exception <- !(before_operator %in% c("!", ":", "(")) Can't it be solve in the package? |
The reason for lintr not liking
The runaround pointed out by @wlandau is also caused by the style guide, because it is inconsistent on whether to put a space in between Regarding these two problems in the tidyverse style guide, I already opened an issue on the style guide's GitHub page: tidyverse/style#66. |
The tidyverse style guide has been updated with a fix: Can this ticket be reopened so
|
Currently this is a violation of the
spaces_left_parentheses_linter
:I think
((
should be legal. Is there a reason it isn't?If this is a mistake, the solution would be to amend https://github.com/jimhester/lintr/blob/master/R/spaces_left_parentheses_linter.R#L27 to include
(
, right?The text was updated successfully, but these errors were encountered: