treefmt icon indicating copy to clipboard operation
treefmt copied to clipboard

Warn on unmatched direct `includes`/`excludes`

Open a-kenji opened this issue 9 months ago • 3 comments

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

When using treefmt in a project for quite a while some configuration can get quite stale. Unmatched files are already conveniently automatically [WARN]ed on, but to take proper advantage of this feature, I usually add those specific files to an exclude list if there is no formatter for this file.

Describe the solution you'd like

I would like a similar warning, if this specifically excluded, or even included file is not in the project anymore.

a-kenji avatar Mar 11 '25 04:03 a-kenji

I don't understand, can you provide some examples?

brianmcgee avatar Mar 11 '25 08:03 brianmcgee

I think the issue @a-kenji describes is something like this:

  1. Create a new hello.foo file.
  2. Notice that treefmt warns that it doesn't know how to format .foo files. Add hello.foo to treefmt's excludes.
  3. Later, remove hello.foo. treefmt doesn't complain, and we are left with unnecessary cruft in the treefmt config.

(similar story with includes)

jfly avatar Mar 11 '25 14:03 jfly

Ok, I understand it now.

brianmcgee avatar Mar 11 '25 15:03 brianmcgee