Open aldoborrero opened 1 year ago
At the moment it looks for .ignore
files during the tree traversal if I'm not mistaken, per the ignore crate. I think it can be extended to also load .gitignore
files?
I think the big question is: are there cases where you want to treefmt a file that is not in git? If yes, then it would be circumventing that use case.
Rationale
Sometimes, you want to exclude directories that don't belong to any specific language but rather because you don't want
treefmt
to traverse those.As far as I'm aware, you need to exclude those from one specific formatter.Note: There's global support for ignoring directories.
We can add support to follow the
.gitignore
options or if.treefmtignore
is present, add those directories to the global config.We can achieve a similar behaviour by leveraging something like
gitignore
crate.