NixOS/nixfmt

Add line length limit which includes indentation

Open

#288 geöffnet am 2. März 2025

Auf GitHub ansehen
 (1 Kommentar) (5 Reaktionen) (0 zugewiesene Personen)Haskell (74 Forks)batch import
enhancementgood first issuehelp wanted

Repository-Metriken

Stars
 (1.506 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 3T 14h) (24 gemergte PRs in 30 T)

Beschreibung

Description

The input is 81 columns wide. If I use --width 80, the output is the same as the input. If I incrementally decrease the width by one character, I find the output does eventually get reflowed at --width 76.

I experienced this on 187985fd1408074a352d3be407bd9524417afe57.

Small example input

    sprinkles = if sprinkles == null then import source.sprinkles else sprinkles;

Expected output

I personally prefer this, but I would also accept the output given with --width 76 which is shown later.

    sprinkles = if sprinkles == null
      then import source.sprinkles
      else sprinkles;

Actual output

At 80 columns:

    sprinkles = if sprinkles == null then import source.sprinkles else sprinkles;

At 76 columns:

    sprinkles =
      if sprinkles == null then import source.sprinkles else sprinkles;

Contributor Guide