Skip to content

Single-line pipes? #74

Closed
Closed

Description

Activity

  1. lorenzwalthert commented on Aug 8, 2017

    @lorenzwalthert
    Collaborator

    Reference (#118).

  2. krlmlr commented on Sep 16, 2017

    @krlmlr
    MemberAuthor
    styler::style_text("a %>% b()")
    #> a %>%
    #>   b()

    The style guide PR has been merged now.

  3. lorenzwalthert commented on Sep 16, 2017

    @lorenzwalthert
    Collaborator

    So does that mean we do not add line breaks after pipes at all anymore?

  4. krlmlr commented on Sep 16, 2017

    @krlmlr
    MemberAuthor

    Not if they fit on a single line. Looking into it right now.

  5. krlmlr commented on Sep 16, 2017

    @krlmlr
    MemberAuthor

    Closed in 9e847af.

  6. added a commit that references this issue on Oct 23, 2017
  7. harrismcgehee commented on Feb 9, 2018

    @harrismcgehee

    How is "if they fit on a single line" defined? Is there a way to turn off single line pipes?

  8. lorenzwalthert commented on Feb 9, 2018

    @lorenzwalthert
    Collaborator

    If I am not mistaken there is currently no option to force a line break after %>%. @krlmlr maybe we should force it for strict = TRUE? Or is that option already overloaded? We could add another option to give granular control.
    Related #65.

  9. krlmlr commented on Feb 10, 2018

    @krlmlr
    MemberAuthor

    They fit on a single line if they don't contain a line break. We currently don't care about line length, but when we have this, we should also break overly long pipes. Not sure if we should turn this on with strict = TRUE or define a new option.

  10. krlmlr commented on Feb 10, 2018

    @krlmlr
    MemberAuthor

    For a one-time transformation, you could do sed -r -i 's/([>]%[>])/\1\n /g' R/* and then apply styler (the -i option must be -ibak on OS X).

  11. lorenzwalthert commented on Feb 18, 2018

    @lorenzwalthert
    Collaborator

    Let's revisit that once we have implemented #247.

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