`treefmt --stdin` doesn't work if the underlying formatter cares about the real filename
Describe the bug
So the default behavior of treefmt, is to to not pass the file path to the downstream formatter if formatting via stdin. But that subtly breaks fourmolu, it fails to pull in the active Haskell extensions. So fourmolu -i -c fat-hs/src/MyLib.hs < fat-hs/src/MyLib.hs works, but fourmolu -i -c < fat-hs/src/MyLib.hs doesn't. I don't quite see from the code, where does the path get omitted, https://github.com/numtide/treefmt/blob/9399cd69f9860bf62fd42479591e0ae39a1b7636/format/formatter.go#L80 I was looking there, and I think it comes from files, which is empty in the case of stdin formatting I guess.
To Reproduce
- clone my thesis repo https://git.redalder.org/magic_rb/bsc-thesis
- try to format
fat-hs/src/MyLib.hsusingtreefmt, so:treefmt --stdin fat-hs/src/MyLib.hs < fat-hs/src/MyLib.hs
Expected behavior
Formatting is consistent between stdin mode and direct mode
System information
NixOS 25.05, exact versions of everything are pinned in https://git.redalder.org/magic_rb/bsc-thesis Additional context