numtide / treefmt

one CLI to format your repo
https://treefmt.com
MIT License
551 stars 33 forks source link

Better error than "thread 'main' panicked at 'assertion failed: command.is_absolute()', src/formatter.rs:165:9" #179

Open justinwoo opened 1 year ago

justinwoo commented 1 year ago

Is your feature request related to a problem? Please describe.

treefmt 0.4.1

I am getting thread 'main' panicked at 'assertion failed: command.is_absolute()', src/formatter.rs:165:9 when treefmt cannot resolve a formatter's filepath (or something).

Describe the solution you'd like

I would like to get a written error message with

Describe alternatives you've considered

Keeping this message the same and requiring everyone to look at the source code to have some clues as to what is going on

Additional context

I assume treefmt is meant to be used by people rather than some scripts

zimbatm commented 1 year ago

Can you share your treefmt.toml and on which OS you're running? If it's reaching the assertions, it's hitting a bug somewhere that I need to reproduce.

zimbatm commented 1 year ago

And also the output of treefmt -vvv, or at least the last line that shows "Found {} at {}"

justinwoo commented 1 year ago

i'm using mac os 12.6 with an M2 with command = "prettier"

zimbatm commented 1 year ago

Can you give me the output of treefmt -vvv 2>&1 | grep " Found " ?