Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pipe operator formatting support #230

Closed
VTimofeenko opened this issue Aug 1, 2024 · 1 comment
Closed

Pipe operator formatting support #230

VTimofeenko opened this issue Aug 1, 2024 · 1 comment

Comments

@VTimofeenko
Copy link

VTimofeenko commented Aug 1, 2024

Description

Nix 2.24 (release announcement post on discourse) added support for experimental pipes (RFC 0148).

I don't believe the exact formatting of code with pipe operator is specified in RFC 0148 or RFC 0166; this issue is about nixfmt not throwing an error when it encounters the pipe operator syntax.

Small example input

1 |> builtins.add 2

Expected output

1 |> builtins.add 2

Actual output

  |
1 | 1 |> builtins.add 2
  |   ^
unexpected '|'
expecting "or", '.', end of input, operator, or term

Steps to reproduce

❯ nix shell "github:NixOS/nixfmt" "github:NixOS/nix?ref=2.24.1"
❯ echo "1 |> builtins.add 2" | nix eval --extra-experimental-features pipe-operators --file -
3
❯ echo "1 |> builtins.add 2" | nixfmt 
<stdin>:1:3:
  |
1 | 1 |> builtins.add 2
  |   ^
unexpected '|'
expecting "or", '.', end of input, operator, or term

@VTimofeenko
Copy link
Author

I managed to completely miss #227

@VTimofeenko VTimofeenko closed this as not planned Won't fix, can't repro, duplicate, stale Aug 1, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Nix formatting Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant