You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The latter looks like it should be two lints to me.
The former is tougher. Should we carve out an exception for {purrr} mappers? OTOH this is like a violation of function_return_linter() -- why have an assignment in a one-line function? If it is <<- (which is also covered by //LEFT_ASSIGN), it's more interesting, but we could still force { to be used instead:
x<-1
map(
.x=1:4,
.f=~ {x<<-.x+x}
)
Of course, that's a brace_linter() violation now, so it would have to be:
Activity
MichaelChirico commentedon Sep 11, 2023
There are two existing tests that would be affected by the simplest fix:
lintr/tests/testthat/test-implicit_assignment_linter.R
Line 84 in 8ac582c
lintr/tests/testthat/test-implicit_assignment_linter.R
Line 295 in 8ac582c
The latter looks like it should be two lints to me.
The former is tougher. Should we carve out an exception for {purrr} mappers? OTOH this is like a violation of
function_return_linter()-- why have an assignment in a one-line function? If it is<<-(which is also covered by//LEFT_ASSIGN), it's more interesting, but we could still force{to be used instead:Of course, that's a
brace_linter()violation now, so it would have to be:cc @IndrajeetPatil