git-hooks.nix icon indicating copy to clipboard operation
git-hooks.nix copied to clipboard

mix-format hook not running on .heex files

Open pikdum opened this issue 6 months ago • 3 comments

Ran into mix format --check failing in CI because my .heex files weren't formatted.

https://github.com/cachix/git-hooks.nix/blob/16ec914f6fb6f599ce988427d9d94efddf25fe6d/modules/hooks.nix#L3217-L3223

I think mix format is extensible, though, so maybe there could be some way to configure extra file extensions? Or could just add .heex?

pikdum avatar Jun 26 '25 06:06 pikdum

Found this list of file extensions elsewhere that mix can format:

      extensions: [
        ".ex",
        ".exs",
        ".eex",
        ".heex",
        ".leex",
        ".neex",
        ".sface",
      ],

pikdum avatar Jun 27 '25 21:06 pikdum

@pikdum, try setting hooks.mix-format.files = "\\.(exs?|heex)$". Does mix-format support this out of the box? If yes, then we can add it in. If not, then probably not.

sandydoo avatar Aug 05 '25 17:08 sandydoo

Yeah, looks like that works.

pikdum avatar Aug 08 '25 21:08 pikdum