I always have issues with getting formatting for Ash-related code to work - I’ve seen it working before, I’ve gotten it working before, but always struggle getting it working on a new project.
I have a brand new Phoenix 1.7.10 app set up, with the latest versions of Ash, AshPostgres and AshPhoenix. I’ve added the deps and the plugin to my .formatter.exs
-
[
import_deps: [:ecto, :ecto_sql, :phoenix, :ash, :ash_postgres, :ash_phoenix],
subdirectories: ["priv/*/migrations"],
plugins: [Phoenix.LiveView.HTMLFormatter, Spark.Formatter],
inputs: ["*.{heex,ex,exs}", "{config,lib,test}/**/*.{heex,ex,exs}", "priv/*/seeds.exs"]
]
But when I do things like add parentheses to functions that shouldn’t have any, or rearrange the top-level blocks in a resource, they don’t get formatted the way they should when I run mix format
.
Formatting is still working, because if I add things like heaps of extra blank lines they get stripped, it’s just the Ash-specific stuff that doesn’t seem to be working.