treefmt icon indicating copy to clipboard operation
treefmt copied to clipboard

`excludes` in `treefmt.toml` are ignored with `--stdin`

Open Stzx opened this issue 7 months ago • 10 comments

Describe the bug

Does treefmt.toml have no effect when using treefmt with --stdin?

To Reproduce

Steps to reproduce the behavior:

  1. configure zed & treefmt as above
  2. edit foo/bar.nix in zed
  3. save

Expected behavior

bar.nix file is not formatted

System information

system: nixos-unstable treefmt: v2.3.1 zed: v0.188.3

Additional context

treefmt.toml

...
[formatter.nixfmt-rfc-style]
command = "nixfmt"
includes = ["*.nix"]
excludes = ["*/bar.nix"]
...

Zed

...
languages = {
  Nix = {
...
    formatter.external = {
      command = "treefmt";
      arguments = ["--stdin" "{buffer_path}"];
    };
  };
};
...

Stzx avatar Jun 05 '25 10:06 Stzx