treefmt-nix icon indicating copy to clipboard operation
treefmt-nix copied to clipboard

Format check fails but `nix fmt` brings no changes.

Open zmrocze opened this issue 1 year ago • 3 comments

Describe the bug

Hi!

Format check fails. But running the formatter doesn't modify anything. It's all formatted but check fails.

To Reproduce

Steps to reproduce the behavior:

At this commit first run:

nix fmt

Observe 0 files changed output.

Then run:

nix build .\#checks.x86_64-linux.treefmt

The build fails.

Expected behavior

The build doesn't fail or the formatter formats.

System information

This flake. That is:

  • treefmt 0.6.0
  • nix 2.18.0
  • treefmt-nix rev 8cd95da6c30852adb2a06c4b6bdacfe8b64a0, used with nixpkgs:
    treefmt-nix = {
      url = "github:numtide/treefmt-nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };

zmrocze avatar Jan 28 '24 11:01 zmrocze

I am also encountering this issue with treefmt v2.0.1, running via cachix/git-hooks.nix.

astratagem avatar Jul 06 '24 00:07 astratagem

https://github.com/numtide/treefmt/issues/342

astratagem avatar Jul 06 '24 05:07 astratagem