nufmt icon indicating copy to clipboard operation
nufmt copied to clipboard

Return invalid code when no `,` in nuon

Open Rignchen opened this issue 1 month ago • 1 comments

Describe the bug

Return invalid code when no , in nuon

nuon doesn't require you to have , to split variables, whitespace are just as valid, since nuon is natively supported by nushell it should also be supported by any nushell formatter

Steps To Reproduce

  1. get some nuon code with | to nuon
  2. remove a one of the comma
  3. try to format it with nufmt
nu -c ('{foobar: [[foo, bar]; [1, 2], [3, 4]], foobar2: [[foo, bar]; [1, 2], [3, 4]]}' | nufmt --stdin)
nu -c ('{foobar: [[foo, bar]; [1, 2], [3, 4]] foobar2: [[foo, bar]; [1, 2], [3, 4]]}' | nufmt --stdin)

Expected behavior

the outputed code should be valid nushell

Environment

  • rustc 1.91.1 (ed61e7d7e 2025-11-07)
[user@system:~]$ rustc --version
output here

If using Nix please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
output here

Notify maintainers

Rignchen avatar Nov 19 '25 14:11 Rignchen

nufmt is pre-alpha and shouldn't be used. However, we'd accept PRs to make it better.

fdncred avatar Nov 19 '25 14:11 fdncred