NixOS/nixfmt

Add line length limit which includes indentation

オープン

#288 opened on 2025/03/02

 (1 件のコメント) (5 件のリアクション) (0 人の担当者)Haskell (74 件のフォーク)batch import
enhancementgood first issuehelp wanted

Repository metrics

Stars
 (1,506 個のスター)
PR merge metrics
 (平均マージ 3h 7m) (30d で 11 merged PRs)

説明

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;

コントリビューターガイド