Skip to content

extra line after comments breaks pipelines #213

Description

@pheenty

Describe the bug

Nufmt adds a newline after comments, potentially breaking pipelines.

Script or statement

$env.config = $env.config
# | upsert edit_mode vi
| upsert show_banner false

Actual behavior/output

$env.config = $env.config
# | upsert edit_mode vi

| upsert show_banner false

The newline added after the comment breaks the pipeline:

Error: nu::parser::input_type_mismatch

  × Command does not support nothing input.
   ╭─[/home/pheenty/a.nu:4:3]
 3 │
 4 │ | upsert show_banner false
   ·   ───┬──
   ·      ╰── command doesn't support nothing input
   ╰────

Expected behavior/output

$env.config = $env.config
# | upsert edit_mode vi
| upsert show_banner false

(nothing should change)

Environment

❯ $nu.os-info
╭────────────────┬───────────────╮
│ name           │ linux         │
│ arch           │ x86_64        │
│ family         │ unix          │
│ kernel_version │ 7.1.8-arch1-3 │
╰────────────────┴───────────────╯
❯ nufmt --version
nufmt 0.1.4

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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