Skip to content

Line breaks and named arguments #246

Closed

Description

@lorenzwalthert

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.

Activity

  1. lorenzwalthert commented on Oct 14, 2017

    @lorenzwalthert
    CollaboratorAuthor

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

  2. lorenzwalthert commented on Jan 6, 2018

    @lorenzwalthert
    CollaboratorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions