-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Run code formatter on lib/ex_unit/lib/ex_unit/formatter.ex #6863
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
Conversation
Enum.map_join(Enum.with_index(failures), "", fn {{kind, reason, stack}, index} -> | ||
{text, stack} = format_kind_reason(test_module, kind, reason, stack, width, formatter) | ||
failure_header(failures, index) <> text <> format_stacktrace(stack, name, nil, formatter) | ||
end) | ||
end | ||
|
||
defp format_kind_reason(test, :error, %ExUnit.AssertionError{} = struct, stack, width, formatter) do | ||
defp format_kind_reason( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks out of place to have a multi-line function head, with a single line function. Suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case it's fine since there's no straightforward way to avoid it (we'd have to maybe make the arguments into a map or something like this but let's keep that for after the formatting craze is over).
|
||
"Finished in #{format_us(total_us)} seconds (#{format_us(load_us)}s on load, #{ | ||
format_us(run_us) | ||
}s on tests)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please split this message into more than one string and concatenate through <>
so that we don't get the ugly split in #{
. This is described in example 4 (which I just added) of #6643.
Enum.map_join(Enum.with_index(failures), "", fn {{kind, reason, stack}, index} -> | ||
{text, stack} = format_kind_reason(test_module, kind, reason, stack, width, formatter) | ||
failure_header(failures, index) <> text <> format_stacktrace(stack, name, nil, formatter) | ||
end) | ||
end | ||
|
||
defp format_kind_reason(test, :error, %ExUnit.AssertionError{} = struct, stack, width, formatter) do | ||
defp format_kind_reason( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case it's fine since there's no straightforward way to avoid it (we'd have to maybe make the arguments into a map or something like this but let's keep that for after the formatting craze is over).
No description provided.