numtide / treefmt

one CLI to format your repo
https://treefmt.com
MIT License
551 stars 33 forks source link

ignore submodules #154

Open nrdxp opened 2 years ago

nrdxp commented 2 years ago

For many uses of submodules the project doesn't necessarily own the rights to the submodule directory so formatting it is just a waste of time since the code cannot be committed. Therefore, we should have an option to skip submodules, possibly by default.

zimbatm commented 2 years ago

I'm not opposed to it but treefmt doesn't know about git or any other SCM at the moment so it would be a jump in complexity for the project.

With the current version you can explicitly ignore all the files in a folder with:

[global]
excludes = ["./path/to/submodule/**"]

(see https://numtide.github.io/treefmt/treefmt-configuration.html#global)