extra line after comments breaks pipelines
Open
Nobody has claimed this yet.
bug
- Dominant language
- Rust
- Stars
- 230
- Forks
- 40
- Avg merge
- 15h 30m
- Merged PRs (30d)
- 1
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Run nufmt 0.1.4 on the supplied Nushell script and compare its output with the expected example. Trace the formatter entry point that handles comments and pipeline lines, then add or update coverage for this reproduction. Done means formatting leaves the comment and following pipeline command adjacent, without introducing a blank line.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100