Skip to content

Double parentheses #82

@rokf

Description

@rokf

Hello,

We've just discussed this issue on Discord.

If I put this content into a Nu file and format it with nufmt it adds parentheses around the whole pipeline starting at $in.

Each save adds another pair of parentheses wrapping the previously added pair.


def in-lang [ln] { $in | items {|k v| {$k: ($v | get $ln | default ($v | get 'en')) } } | reduce -f {} {|it acc| $acc | merge $it } }

becomes

def in-lang [ln] { ($in | items {|k v| {$k: ($v | get $ln | default ($v | get 'en')) } } | reduce -f {} {|it acc| $acc | merge $it }) }

which I don't expect to happen.


Seems to be related to #76. I've reinstalled nufmt to get the latest version (main) with cargo install --force --git https://github.com/nushell/nufmt. Proof:

Replaced package `nufmt v0.1.0 (https://github.com/nushell/nufmt#f4cc3496)` with `nufmt v0.1.0 (https://github.com/nushell/nufmt#f4cc3496)` (executable `nufmt`)

Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions