Skip to content

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

Merged
merged 1 commit into from
Oct 11, 2017

Conversation

volcov
Copy link
Contributor

@volcov volcov commented Oct 11, 2017

No description provided.

%{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,
Copy link
Member

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: #{
Copy link
Member

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}, %{
Copy link
Member

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.

@josevalim josevalim merged commit c32705a into elixir-lang:master Oct 11, 2017
@josevalim
Copy link
Member

❤️ 💚 💙 💛 💜

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

Successfully merging this pull request may close these issues.

2 participants