NixOS/nixfmt

Add line length limit which includes indentation

Open

#288 创建于 2025年3月2日

在 GitHub 查看
 (1 评论) (5 反应) (0 负责人)Haskell (1,506 star) (74 fork)batch import
enhancementgood first issuehelp wanted

描述

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;

贡献者指南

Add line length limit which includes indentation · NixOS/nixfmt#288 | Good First Issue