Skip to content

Bug: nested functions do not get unnested into pipes #216

@emkguts

Description

@emkguts

Here are two test cases:

Test 1:

assert_style("c(b(a), d)", "a |> b() |> c(d)")

Output (while messing with a local copy):

  1) test pipifying pipifying (Styler.Style.PipesTest)
     test/style/pipes_test.exs:945
     Styling produced unexpected results
     expected:
       a |> b() |> c(d)
     styled:
       c(b(a), d)

     code: assert_style("c(b(a), d)", "a |> b() |> c(d)")
     stacktrace:
       test/style/pipes_test.exs:948: (test)

Test 2:

assert_style("c(b(a |> e), d)", "a |> e() |> b() |> c(d)")

Output:

  1) test pipifying pipifying (Styler.Style.PipesTest)
     test/style/pipes_test.exs:945
     Styling produced unexpected results
     expected:
       a |> e() |> b() |> c(d)
     styled:
       c(a |> e() |> b(), d)

     code: assert_style("c(b(a |> e), d)", "a |> e() |> b() |> c(d)")
     stacktrace:
       test/style/pipes_test.exs:948: (test)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions