-
Notifications
You must be signed in to change notification settings - Fork 9
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
RHS assignment persistent line breaks introduce extra indentation in pipes #220
Comments
I feel like that kind of goes against the spirit of the pipe chain though, right? i.e. pipe chains work like:
I am imagining that in your head |
I know this is definitely an opinion, but I am a big fan of the kind of indentation @gadenbuie shows here. You can see how I use this in my blog posts such as:
This would probably be enough to have me not use air honestly. 😬 |
I have looked at some additional examples and feel that you are both probably right here. This is a particularly unique example ("assignment with rhs starting on its own line leading into a pipe chain"), so it will have to be tightly scoped and special cased, because we still want normal pipe indentation pretty much everywhere else. But it is worth trying to fix up. It is also in the style guide and has been this way for many years If we document this behavior I think we should justify it in the way I mentioned earlier. In these examples, in your head you aren't starting the pipe chain at data <-
starwars |>
filter(height > 172) |>
select(1:3)
hotel_rec <-
recipe(avg_price_per_room ~ ., data = hotel_train) %>%
step_YeoJohnson(lead_time) %>%
step_dummy_hash(agent, num_terms = tune("agent hash")) %>%
step_dummy_hash(company, num_terms = tune("company hash")) %>%
step_zv(all_predictors()) |
As a fan of the persistent line break in this case, I really want all of the expressions in the pipeline to be indented to the same level:
The text was updated successfully, but these errors were encountered: