From ffa199a640df18574ef4a59eb71346737458c6e4 Mon Sep 17 00:00:00 2001 From: Matt Enlow Date: Fri, 5 Apr 2024 11:54:19 -0600 Subject: [PATCH] Apply config sorting to `rel/overlay/.*.exs` --- CHANGELOG.md | 1 + lib/style/configs.ex | 2 +- test/style/configs_test.exs | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac669312..fed877b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ ### Breaking Changes * drop support for elixir `1.14` +* sorting configs for the first time can change your configuration; see `Styler.Style.Configs` moduledoc for more ## v0.11.9 diff --git a/lib/style/configs.ex b/lib/style/configs.ex index 5a7f4bc6..dddcb5fd 100644 --- a/lib/style/configs.ex +++ b/lib/style/configs.ex @@ -82,7 +82,7 @@ defmodule Styler.Style.Configs do end def run(zipper, %{file: file} = ctx) do - if file =~ ~r|config/.*\.exs| do + if file =~ ~r|config/.*\.exs| or file =~ ~r|rel/overlay/.*\.exs| do {:cont, zipper, Map.put(ctx, :config?, true)} else {:halt, zipper, ctx} diff --git a/test/style/configs_test.exs b/test/style/configs_test.exs index 3a36dd6a..4a09b727 100644 --- a/test/style/configs_test.exs +++ b/test/style/configs_test.exs @@ -22,6 +22,7 @@ defmodule Styler.Style.ConfigsTest do # :config? is private api, so don't be surprised if this has to change at some point assert {:cont, _, %{config?: true}} = Configs.run(zipper, %{file: "apps/foo/config/#{file}"}) assert {:cont, _, %{config?: true}} = Configs.run(zipper, %{file: "config/#{file}"}) + assert {:cont, _, %{config?: true}} = Configs.run(zipper, %{file: "rel/overlay/#{file}"}) assert {:halt, _, _} = Configs.run(zipper, %{file: file}) end end