-
Notifications
You must be signed in to change notification settings - Fork 129
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
Covering all patterns and preventing errors #133
Conversation
Thanks for the PR! It seems one of the test is failing. Corresponding test code can be updated for this change? |
0db2a0e
to
43f6e9b
Compare
fix conflict and test case :) |
@@ -100,44 +106,48 @@ defmodule ExTwitterTest do | |||
|
|||
test "shows retweets" do | |||
use_cassette "retweets" do | |||
retweets = ExTwitter.retweets(444144169058308096, count: 1) | |||
retweets = ExTwitter.retweets(444_144_169_058_308_096, count: 1) |
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.
Thanks for the fix.
The test code change is coming from the code formatter?
Indentation change may be ok, but I think ID format is just a sequence of digits rather than numeric value, and I don't think splitting by 3 digits makes much sense.
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.
The test code change is coming from the code formatter?
Yes!
I don't think splitting by 3 digits makes much sense.
I agree with you; 444144169058308096 is a number that represents an id that is not particularly meaningful here, and readability is not required here.
But the important fact here is not whether this number conversion is meaningful or not, but rather that the official Elixir formatter made the change to this code.
Almost all good Elixir developers include a setting that uses formatting all the time (with settings of editor). It's also one of the nice things about Elixir that there is an official formatter and that everyone uses the same formatter.
The PRs from those developers will contain the same diffs every time, so I'd prefer to keep the numbers with _ in them
(If you still want to roll back these changes, I'll roll back these changes :) )
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.
Thanks for the description, and I understood that putting special treatment make it cumbersome.
Did this change the response of access_token from Looks like this is a breaking change. |
Ops, thanks for the report. I wasn't intending to change the existing behavior. Maybe I should revert this change and re-introduce in different manner? |
Sorry, but please let me revert at first (though the original return-value I/F and error handling may not be good), I wasn't thinking enough about the change in test-code part. |
I change the behaviour from Maybe I should have split the PR, sorry :'-( |
@sanposhiho @parroty it's ok, but it would definitely help to be more clear in the changelog & versioning. Thanks for your quick work on this! |
Hi :)
fix auth.ex to cover all patterns and preventing errors
Including this change will give you peace of mind if we get an unintended response :)
For Example
httpc.request may return {:error, hoge}, and down application using extwitter, because you intended only httpc.request return {:ok, hogehoge}
http://erlang.org/doc/man/httpc.html