numtide / treefmt

one CLI to format your repo [maintainers=@zimbatm,@brianmcgee]
https://treefmt.com
MIT License
575 stars 35 forks source link

`treefmt` spits out many unimportant warnings on first run/clean cache #338

Closed michaelpj closed 2 months ago

michaelpj commented 2 months ago

Describe the bug

When you run treefmt for the first time, or with a clean cache, it seems to emit a warning for every file in your repository that doesn't have a formatter.

e.g.

WARN format: no formatter for path: .../foo.sql

This seems weird to me. It's going to be normal to not format many or most files in your repository, and in pretty much no circumstance do I want to be aware of that?

brianmcgee commented 2 months ago

The warning is emitted the first time with a cold cache and is intended to help users catch when they've missed some files that should be formatted.

It's a warn by default but can be controlled via the -u --on-unmatched flag and demoted to info or lower. This is useful for CI where you typically run with --no-cache.

https://treefmt.com/usage.html#u-on-unmatched

michaelpj commented 2 months ago

I'd be somewhat inclined to flip the polarity so you have to actively ask for information on unmatched files if you want it, but I get the idea.

brianmcgee commented 2 months ago

I'd like to run with it as-is for now. If more feedback comes in that it's more annoying than useful, I'll move it to info by default.