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
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .formatter.exs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,17 @@ locals_without_parens = [
on_mount: 1,
slot: 1,
slot: 2,
slot: 3
slot: 3,

# Phoenix.LiveViewTest
assert_patch: 2,
kelvinst marked this conversation as resolved.
Show resolved Hide resolved
assert_patch: 3,
assert_patched: :2,
assert_push_event: 4,
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.

]

[
Expand Down
Loading