From ad97280b7ca7d6757d092ac5a9eb396827a245c1 Mon Sep 17 00:00:00 2001 From: Kelvin Stinghen Date: Fri, 29 Nov 2024 11:26:47 -0300 Subject: [PATCH 1/2] Add LiveViewTest.assert_* macros to locals_without_parens config So one can simply add `:phoenix` to their `:plugins` option in `.formatter.exs` and it will not automatically include parens to those functions when `mix format`ing --- .formatter.exs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.formatter.exs b/.formatter.exs index 6a017ae873..820d7896c6 100644 --- a/.formatter.exs +++ b/.formatter.exs @@ -76,7 +76,17 @@ locals_without_parens = [ on_mount: 1, slot: 1, slot: 2, - slot: 3 + slot: 3, + + # Phoenix.LiveViewTest + assert_patch: 2, + assert_patch: 3, + assert_patched: :2, + assert_push_event: 4, + assert_redirect: 2, + assert_redirect: 3, + assert_redirected: 2, + assert_reply: 3 ] [ From b58c4bf0deb51f7294a549856cecf35870afcc8b Mon Sep 17 00:00:00 2001 From: Kelvin Stinghen Date: Fri, 29 Nov 2024 14:26:17 -0300 Subject: [PATCH 2/2] Adding refute_* and optional args functions too --- .formatter.exs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.formatter.exs b/.formatter.exs index 820d7896c6..e9b13e6e35 100644 --- a/.formatter.exs +++ b/.formatter.exs @@ -79,14 +79,21 @@ locals_without_parens = [ slot: 3, # Phoenix.LiveViewTest + assert_patch: 1, assert_patch: 2, assert_patch: 3, - assert_patched: :2, + assert_patched: 2, + assert_push_event: 3, assert_push_event: 4, + assert_redirect: 1, assert_redirect: 2, assert_redirect: 3, assert_redirected: 2, - assert_reply: 3 + assert_reply: 2, + assert_reply: 3, + refute_redirected: 2, + refute_push_event: 3, + refute_push_event: 4 ] [