-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
treefmt treats relative paths as relative to the tree root, rather than the current working directory #443
Labels
bug
Something isn't working
Comments
jfly
changed the title
treefmt mis-handles relative paths when you're in a subdir of the project
treefmt treets relative paths as relative to the tree root, rather than the current working directory
Oct 12, 2024
jfly
changed the title
treefmt treets relative paths as relative to the tree root, rather than the current working directory
treefmt treats relative paths as relative to the tree root, rather than the current working directory
Oct 12, 2024
jfly
added a commit
to jfly/treefmt
that referenced
this issue
Oct 12, 2024
This fixes a few issues with both relative and absolute paths: - Previously, treefmt refused to format any files passed as absolute paths, regardless of if they were in tree or not: numtide#442 - Previously, treefmt would treat relative paths as relative to the project root, which is not ideal if you're in a subdirectory and you just want to format the file you're right next to: numtide#443 - There was even a test asserting this behavior. I changed it to reflect the updated behavior. - treefmt's handling of paths outside of the project root was a bit inconsistent: numtide#444
Fix out for review here: #445 |
jfly
added a commit
to jfly/treefmt
that referenced
this issue
Oct 12, 2024
This fixes a few issues with both relative and absolute paths: - Previously, treefmt refused to format any files passed as absolute paths, regardless of if they were in tree or not: numtide#442 - Previously, treefmt would treat relative paths as relative to the project root, which is not ideal if you're in a subdirectory and you just want to format the file you're right next to: numtide#443 - There was even a test asserting this behavior. I changed it to reflect the updated behavior. - treefmt's handling of paths outside of the project root was a bit inconsistent: numtide#444
Fixed with #445 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The text was updated successfully, but these errors were encountered: