treefmt icon indicating copy to clipboard operation
treefmt copied to clipboard

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

Open justinwoo opened this issue 3 years ago • 4 comments

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

  • What was attempted
  • What was expected
  • What is a possible resolution

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

justinwoo avatar Sep 20 '22 12:09 justinwoo

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 avatar Sep 20 '22 13:09 zimbatm

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

zimbatm avatar Sep 20 '22 13:09 zimbatm

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

justinwoo avatar Sep 20 '22 13:09 justinwoo

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

zimbatm avatar Sep 20 '22 14:09 zimbatm