numtide / treefmt

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

Filesystem walker should be configurable in config #394

Closed ratorx closed 1 month ago

ratorx commented 1 month ago

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

Git walker is opted in by default within a git repository with no way to opt-out without specifying the CLI arg with every invocation. This is undesirable as the git walker is not necessarily better.

The git formatter ignores untracked files by default, which is undesirable for me because I often create new files with sloppy formatting expecting the formatter to clean up before modifying it more. Having to leave the context and run the command to add the file to git is annoying.

The filesystem formatter is clearly better for my usecase, but right now I have to opt-in to it for every command, just because I am using git for version control. I think the conflict is in the assumption that "git used for version control => only format staged or tracked files".

Describe the solution you'd like

Include untracked files when using the git formatter (configurable), or allow the walker to be overridden in config.

brianmcgee commented 1 month ago

Related to / duplicate of https://github.com/numtide/treefmt/issues/351.

I have time next week to knock out some low-hanging fruit, and this will be one of them.

ratorx commented 1 month ago

Thanks, I think that feature would completely fix my use case.

Duplicate of https://github.com/numtide/treefmt/issues/351