-
Notifications
You must be signed in to change notification settings - Fork 3.4k
run the code formatter on calendar/date #6888
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
%{calendar: calendar, year: year2, month: month2, day: day2}) do | ||
@spec compare(Calendar.date(), Calendar.date()) :: :lt | :eq | :gt | ||
def compare(%{calendar: calendar, year: year1, month: month1, day: day1}, %{ | ||
calendar: calendar, |
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.
We can probably write this one as:
def compare(%{calendar: calendar} = date1, %{calendar: calendar} = date2) do
%{year: year1, month: month1, day: day1} = date1
%{year: year2, month: month2, day: day2} = date2
Could you please give it a tru?
{:error, reason} -> | ||
raise ArgumentError, "cannot convert #{inspect date} to target calendar #{inspect calendar}, reason: #{inspect reason}" | ||
raise ArgumentError, | ||
"cannot convert #{inspect(date)} to target calendar #{inspect(calendar)}, 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.
Please use <> "reason #{inspect(reason)} "
at the end and format again.
def diff(%{calendar: Calendar.ISO, year: year1, month: month1, day: day1}, | ||
%{calendar: Calendar.ISO, year: year2, month: month2, day: day2}) do | ||
@spec diff(Calendar.date(), Calendar.date()) :: integer | ||
def diff(%{calendar: Calendar.ISO, year: year1, month: month1, day: day1}, %{ |
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 change similar to compare/2
.
❤️ 💚 💙 💛 💜 |
No description provided.