Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add LiveViewTest.assert_* macros to locals_without_parens config #5991

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kelvinst
Copy link
Contributor

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 formating

Original PR phoenixframework/phoenix_live_view#3535

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
Copy link
Contributor

@SteffenDE SteffenDE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add refute_push_event/4 (phoenixframework/phoenix_live_view#3490)

.formatter.exs Outdated
assert_redirect: 2,
assert_redirect: 3,
assert_redirected: 2,
assert_reply: 3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have assert_reply/3 in line 53. I don't know if duplicates are a problem though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for duplicates, they shouldn't affect the code, as the function that checks them will work the same (it basically just Enum.any? this list here: https://github.com/elixir-lang/elixir/blob/44107f1010229f58d899177e34eb04357a075ab3/lib/elixir/lib/code/formatter.ex#L180-L185

IMO we should leave it here, just in case someday someone removes one of these sections.

.formatter.exs Show resolved Hide resolved
@kelvinst
Copy link
Contributor Author

kelvinst commented Dec 4, 2024

Not sure if the failing checks have something to do with my change. Anything else I need to do here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants