Skip to content

Remove redundant parentheses #330

@wolfgangwalther

Description

@wolfgangwalther

Description

Redundant parentheses should be removed automatically. nixf-tidy / nixf-diagnose reports them, but can't auto-fix. I assume that removing these is likely much easier implemented in nixfmt than nixf-diagnose, which doesn't do any rewriting, so far.

Small example input

Random example from running nixf-diagnose on Nixpkgs:

with pkgs.perl.pkgs; makeFullPerlPath ([ mod_perl2 ])

Expected output

with pkgs.perl.pkgs; makeFullPerlPath [ mod_perl2 ]

Actual output

with pkgs.perl.pkgs; makeFullPerlPath ([ mod_perl2 ])

If this is done, #251 should probably be done first. In a way, this is also a counter-example that shows us that "redundant" is subjective... On the other side, if we want this, then that's an argument to put it into nixfmt, because that's the only way to make it play along with that issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions