numtide / treefmt-nix

treefmt nix configuration
https://numtide.github.io/treefmt/
MIT License
213 stars 62 forks source link

global ignore/exclude #171

Closed quinn-dougherty closed 1 month ago

quinn-dougherty commented 4 months ago

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

I'm working with git submodules, and they currently feel incompatible with treefmt-nix.

Describe the solution you'd like

treefmt.config.settings.exclude = [ "dir1" "dir2" ]

Describe alternatives you've considered

settings.formatter = {
        prettier.excludes = [ "submoduleA/" ];
        black.excludes = [ "submoduleA/" ];
      };

this did not work.

zimbatm commented 4 months ago

try treefmt.config.settings.global.excludes = [ "dir1" "dir2" ]

zimbatm commented 1 month ago

assuming it's fixed

SebTM commented 1 month ago

Works for me but for anyone else searching: folder/** is the required format (at least for me excluding a submodule recursive) - also the option appears to be called excludes not exclude and for me it does not throw an error just ignores the (invalid?) option ✌🏻