Open dfsnow opened 1 year ago
FWIW, here is what both {lintr} and {styler} can agree to:
library(dplyr)
mtcars %>%
rename(
big_long_prefix_num_cylinders = cyl,
big_long_prefix_horsepower = hp,
big_long_prefix_weight = wt,
big_long_prefix_automatic = am
) %>%
mutate(
big_long_column_name_that_cant_fit_in_col_limit = {
mpg == (big_long_prefix_num_cylinders * big_long_prefix_horsepower) &
(big_long_prefix_weight * big_long_prefix_automatic)
}
)
mtcars[
,
big_long_column_name_that_cant_fit_in_col_limit :=
round(big_long_prefix_num_cylinders - big_long_prefix_horsepower, 2)
]
Related to #2007
Just wanted to say thanks for looking into these consistency issues, very important work! Just ran into the inconsistencies and for now need to disable the indentation linter to avoid too much work ...
Possibly related to: https://github.com/r-lib/lintr/issues/2011#issuecomment-1661957104.
indentation_linter
andstyler
do not agree in some cases using long column names inside a function.Reprex dplyr
This configuration results in the
lintr
error:In other words,
lintr
wants the format below, whichstyler
will auto-fix:Reprex data.table
Here's another example using
data.table
:lintr
throws an error:lintr
wants this format, whichstyler
will auto-fix:SessionInfo