numtide / treefmt-nix

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

Configurable includes for elm-format #164

Closed marc136 closed 7 months ago

marc136 commented 7 months ago

This change allows to pass a list of includes to the elm-format configuration and is an addition after #163.

I want to add this configuration option because in a project I generate a lot of Elm code from another tool. Those generated files are not checked in into source control and don't fully follow the elm-format code formatting.

With this change, I can pass include rules that allow me to only format the files that are actually part of the repository and ignore the generated files.

  programs.elm-format.enable = true;
  programs.elm-format.includes = [ "src/Main.elm" ];

Thank you for your time and for creating this tool.
I'm not sure if the desired approach is to immediately create a PR, or first discuss why I would like to add this change.

I copied the code from the biome configuration and adapted it.

marc136 commented 7 months ago

Sorry, I did not run nix fmt on the changes and now force-pushed the change to keep the history clean.

zimbatm commented 7 months ago

thanks!