Skip to content
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

Line breaks and named arguments #246

Closed
lorenzwalthert opened this issue Oct 14, 2017 · 2 comments
Closed

Line breaks and named arguments #246

lorenzwalthert opened this issue Oct 14, 2017 · 2 comments

Comments

@lorenzwalthert
Copy link
Collaborator

lorenzwalthert commented Oct 14, 2017

Line breaks should not be forced after the opening brace of a function call if the call follows a structure like

map(x, c, 
  furher_arg = 3,
  another_arg = 2:4
)

Reference: tidyverse/style#39

Hence, when modifying line breaks after (, one has to check the structure and only break the line before the first named argument.
More concretely,

  • if expression is a function call,
  • and expression spans over multiple lines
  • find the first named argument and add a line break before it.
  • If no named argument occurs (but there is at least one argument), break after opening brace.
@lorenzwalthert
Copy link
Collaborator Author

lorenzwalthert commented Oct 14, 2017

Not super urgent since line breaks after opening brace for function calls is only effective with strict = TRUE (#198).

@lorenzwalthert
Copy link
Collaborator Author

It sees to me that we probably underestimated the priority of this issue in the light of tidyverse/tidyr#393

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant