-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
indentation_linter disagrees with styler indentation #2034
Labels
Comments
dfsnow
added a commit
to ccao-data/ptaxsim
that referenced
this issue
Aug 2, 2023
The rules followed by indentation_linter aren't consistent with those from styler, so one or the other will throw an error unless one is disabled. See r-lib/lintr#2034
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 ... |
15 tasks
2 tasks
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Possibly related to: #2011 (comment).
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
The text was updated successfully, but these errors were encountered: