-
Notifications
You must be signed in to change notification settings - Fork 165
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
Remove lint warnings #337
Remove lint warnings #337
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #337 +/- ##
============================================
+ Coverage 86.78% 87.07% +0.28%
- Complexity 371 372 +1
============================================
Files 33 32 -1
Lines 1415 1408 -7
Branches 165 164 -1
============================================
- Hits 1228 1226 -2
+ Misses 117 114 -3
+ Partials 70 68 -2 ☔ View full report in Codecov by Sentry. |
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.
Some of the changes affect the public API that devs might be using (see comment), the rest looks good, thanks for the cleanup 👍
@@ -30,9 +30,8 @@ public TrackMe(TrackMe trackMe) { | |||
/** | |||
* Adds TrackMe to this TrackMe, overriding values if necessary. | |||
*/ | |||
public TrackMe putAll(@NonNull TrackMe trackMe) { | |||
public void putAll(@NonNull TrackMe trackMe) { |
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 changes the public API.
It returns itself so devs can chain calls.
e.g. TrackMe().putAll(...).trySet(...)
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.
Fine, but the sample is anyhow to outdated and too simple #338
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.
Do you mean extending the sample app so the linter no longer marks this as unused?
I don't think the sample app has to include all and every API call the SDK has, I'm not opposed to anyone making the sample app better either 😄)
We just have to be a bit careful with refactoring.
The linter doesn't know it's an SDK and code is used outside the project 😁
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.
Sure, I as a customer will only use stuff I find in sample app. It's just a note.
The linter doesn't know it's an SDK and code is used outside the project
yes, maybe annotate it with "ignore warning" is a way to go
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.
Till now, I ignored my wish to kotlize it.
Kotlin has some wonderful mechanism for a sdk, e.g internal
*/ | ||
public synchronized TrackMe trySet(@NonNull QueryParams key, int value) { | ||
return trySet(key, String.valueOf(value)); | ||
public synchronized void trySet(@NonNull QueryParams key, int value) { |
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.
Changes public API, see above.
*/ | ||
public synchronized TrackMe trySet(@NonNull QueryParams key, float value) { | ||
return trySet(key, String.valueOf(value)); | ||
public synchronized void trySet(@NonNull QueryParams key, float value) { |
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.
Changes public API, see above.
} | ||
|
||
public synchronized TrackMe trySet(@NonNull QueryParams key, long value) { | ||
return trySet(key, String.valueOf(value)); | ||
public synchronized void trySet(@NonNull QueryParams key, long value) { |
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.
Changes public API, see above.
*/ | ||
public synchronized TrackMe trySet(@NonNull QueryParams key, String value) { | ||
public synchronized void trySet(@NonNull QueryParams key, String value) { |
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.
Changes public API, see above.
@@ -43,9 +43,8 @@ public int getSiteId() { | |||
/** | |||
* A unique name for this Tracker. Used to store Tracker settings independent of URL and id changes. | |||
*/ | |||
public TrackerBuilder setTrackerName(String name) { | |||
public void setTrackerName(String name) { |
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.
Changes public API (chaining calls on a builder object Builder().doA().doB()
@@ -58,9 +57,8 @@ public String getTrackerName() { | |||
* | |||
* @param domain your-domain.com | |||
*/ | |||
public TrackerBuilder setApplicationBaseUrl(String domain) { | |||
public void setApplicationBaseUrl(String domain) { |
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.
Changes public API
@@ -70,9 +70,8 @@ public CustomVariables(@Nullable String json) { | |||
} | |||
} | |||
|
|||
public CustomVariables putAll(CustomVariables customVariables) { | |||
public void putAll(CustomVariables customVariables) { |
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.
Changes public API
abstract class Custom implements Extra { | ||
} | ||
|
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.
I agree, this is kind of superfluos, but it's part of the public API and some devs might have extended this.
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.
Keeping this unused stuff is a kind of collect a lot waste in your base ground.
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 remove it, but then with a major version bump and a little note about migration in the changelog (e.g. don't extend Custom
, just implement Extra
).
8b21ffa
to
c972329
Compare
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.
Thank you!
You could do a Kotlin rewrite if you want :). |
In an ideal world, the api is done by interfaces and anything behind will be done This keeping unused classes because someone could use it, is an afford without benefit. |
Why do you keep coming back to this? 😄
Not everything needs to be a firebase-level SDK with shovels of abstraction. Interfaces can still be introduced now if desired. As said, you can make a v5, with everything new and better if you want to 👍. |
Sorry, those were just a few thoughts on the Kotlin transformation. |
I followed the suggestion from lint