oh, excellent! Thanks! On Wednesday, February 2, 2022 at 10:46:52 AM UTC-5 José Valim wrote:
> We have added support for overwriting the formatter for .ex and .exs in > the v1.13 branch. It may have been released on v1.13.2 already. > > On Wed, Feb 2, 2022 at 4:40 PM Zach Daniel <[email protected]> wrote: > >> I've tried setting the extensions list to `[".ex", ".exs"]`, but it looks >> like it isn't possible to write a custom formatter that would run on elixir >> files. The use case (something that Ash users are currently asking for) is >> a way to enforce consistency in their usage of the DSL using a formatter of >> some kind. I could go the route that surface originally went w/ a custom >> mix task for formatting, but being a formatter plugin would be *far* >> simpler. >> >> So some potential ideas that would let me do this: >> >> 1. allow writing a plugin that takes .ex and .exs files and formats them >> either ahead of or behind the main formatter (ahead of would be better in >> this case because I'll want to run the formatter on the code after I've >> done my work). >> >> 2. allow specifying that `use`ing certain modules causes the contents of >> the using module to be formatted by my plugin, e.g `sigils: [], extensions: >> [".ex", ".exs"], using: [Ash.Resource]` (this would end up being >> configurable by end users because some Ash users have a resource wrapper, >> e.g `use MyApp.Resource`) >> >> I'm happy to PR either of the above, or something else :) >> >> -- >> You received this message because you are subscribed to the Google Groups >> "elixir-lang-core" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/elixir-lang-core/e8503ea8-1b43-449a-b6dd-ac4d5c832e64n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/elixir-lang-core/e8503ea8-1b43-449a-b6dd-ac4d5c832e64n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/bf54251e-b033-4c9a-8cd6-4cb9b2324f10n%40googlegroups.com.
