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
I want to configure my .lintr file to allow for the %<>% operator.
However, using assignment_linter with argument operator containing %<>% is causing strange lintr errors with unrelated lines in my .R files - specifically, it appears to be related to function default arguments as in a = "test" below.
Please see this reprex and the associated error below:
library(lintr)
lines<- c(
'f <- function(',
' a = "test"',
') {',
'}'
)
lint(
text=lines,
linters= assignment_linter(operator= c("<-"))
)
#> ℹ No lints found.
lint(
text=lines,
linters= assignment_linter(operator= c("%<>%"))
)
#> Error in `lint()`:#> ! Linter `linter()` failed in '/tmp/RtmpI5xsy4/fileba94779980551':#> Caused by error in `sprintf()`:#> ! invalid format '%<>% f'; use format %s for character objects
Uh oh!
There was an error while loading. Please reload this page.
I want to configure my .lintr file to allow for the
%<>%
operator.However, using
assignment_linter
with argumentoperator
containing%<>%
is causing strange lintr errors with unrelated lines in my .R files - specifically, it appears to be related to function default arguments as ina = "test"
below.Please see this reprex and the associated error below:
Created on 2025-04-22 with reprex v2.1.1
The text was updated successfully, but these errors were encountered: