-
Notifications
You must be signed in to change notification settings - Fork 186
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
Disagreement between {styler}
and indentation_linter()
about multiline conditional expressions
#2007
Comments
I'm also seeing many such examples. I haven't had a chance to understand if they all fit the same rule as this issue. I'll post more examples if they look different enough. FWIW I think indentation_linter gets it right here. if |
Here's one where I think {lintr} is wrong: stopifnot(
`A very long test failure description` =
inherits(found, "error") &&
grepl("A regex to be found in the.*parent", found$parent$message)
) |
Here's another one I think {lintr} is wrong: FOO <- function(opt = c(
"opt1", "opt2", "opt3", "opt4", ...
),
...) {
...
} This might be better using the double-indent declaration style, but not always so. |
Another one that looks wrong for {lintr}: foo <- function() {
return(unique(subset(geo,
RegionCode == "US",
select = c("AdminLevel1Code", "AdminLevel2Name")
)))
} |
I have another example that appears to be related. This is styled according to txsamp <- subset(txhousing, city %in% c("Houston", "Fort Worth", "San Antonio", "Dallas", "Austin"))
(d <- ggplot(data = txsamp, aes(x = sales, y = median)) +
geom_point(aes(colour = city)))
(p <- ggplot(txsamp, aes(x = median, fill = city)) +
geom_histogram(position = "dodge", binwidth = 15000))
(v <- ggplot(faithfuld) +
geom_tile(aes(waiting, eruptions, fill = density))) |
Hey @AshesITR it would be nice to have some progress on Some suggestions:
Thanks! |
Hi, I've cleaned up some issues. Unfortunately, none of the indentation issues that are still open seem particularly easy to tackle. |
This is reported in r-lib/styler#1065, but I'd also like to track this in
{lintr}
:Created on 2023-07-20 with reprex v2.0.2
Session info
The text was updated successfully, but these errors were encountered: