Skip to content

Use vertical layout when default operator ? used in pattern #472

@leana8959

Description

@leana8959

Hello,

The ? operator can attach an expression that will be used as the default value of the argument, I think it is worth breaking the argument into multiple lines in this case.

Currently in alejandra the following lambda argument pattern is kept on the same line:

{nixpkgs ? import <nixpkgs> {}}:
{...}

I'm thinking maybe we could use the vertical layout when the default operator is used once or more?
The same example will be as follows:

```nix
{
  nixpkgs ? import <nixpkgs> {},
}:
{...}

Thanks for your time and the project :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions