Skip to content

Alternative specification for pipe formatting #60

Open
@CabalCrow

Description

@CabalCrow

The specification.md describes the default formatting for pipelines to be a wall of lines.

def "apply to" [
    file: path
    modification: closure
] {
    $file
    | path expand
    | open --raw
    | from toml
    | do $modification
    | save --force $file
}

In the nushell discord fdncred mentioned how this creates issues with copy pasting code to the terminal on windows. Because of this I would like to suggest alternative formatting & indenting:

def "apply to" [
    file: path
    modification: closure
] {
    $file |
        path expand |
        open --raw |
        from toml |
        do $modification |
        save --force $file
}

This python style indenting still showcases that a pipeline is continued, despite that the pipe symbol is not at the start of the line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions