-
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 refuses to format files when invoked with their absolute paths #442
Labels
bug
Something isn't working
Comments
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
This was referenced Oct 12, 2024
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
Tracked relative paths get formatted:
Untracked relative path get formatted (thanks @brianmcgee! this works now because of #438):
Tracked absolute paths get skipped:
Untracked absolute paths get skipped:
To Reproduce
Here's the setup for the above commands:
Expected behavior
I'd expect treefmt to format these files.
System information
See above. I'm using 659aa0f.
The text was updated successfully, but these errors were encountered: