Closed jfly closed 1 month ago
treefmt refuses to format files relative to $PWD when I'm in a subdirectory of my project.
This works:
./ $ treefmt subdir/tracked.py traversed 1 files emitted 1 files for processing formatted 1 files (0 changed) in 143ms
But if I'm in subdir/:
subdir/
subdir/ $ treefmt ./tracked.py Error: path ./tracked.py not found within the tree root /tmp/tmp.NFu4zPpIQ9
But this does work if I use the same relative path from before:
subdir/ $ treefmt subdir/tracked.py traversed 1 files emitted 0 files for processing formatted 0 files (0 changed) in 17ms
To Reproduce
Here's the setup for the above commands:
$ cd "$(mktemp -d)" $ git init $ mkdir subdir $ touch subdir/tracked.py $ git add --intent-to-add subdir/tracked.py $ nix shell github:numtide/treefmt nixpkgs#black $ treefmt --version treefmt v659aa0f $ cat treefmt.toml # create this file [formatter.python] command = "black" includes = ["*.py"]
Expected behavior
I expect treefmt to interpret relative paths relative to the current working directory, not the tree root.
System information
See above. I'm using 659aa0f.
Fix out for review here: https://github.com/numtide/treefmt/pull/445/
Fixed with #445
treefmt refuses to format files relative to $PWD when I'm in a subdirectory of my project.
This works:
But if I'm in
subdir/
:But this does work if I use the same relative path from before:
To Reproduce
Here's the setup for the above commands:
Expected behavior
I expect treefmt to interpret relative paths relative to the current working directory, not the tree root.
System information
See above. I'm using 659aa0f.