Skip to content

Fix Lint Issues #171: Fix numerous errors/warnings #2537

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
Mar 10, 2019

Conversation

ronanb80
Copy link
Contributor

@ronanb80 ronanb80 commented Mar 3, 2019

Fixes numerous Lint errors and warnings:

  • Change Android Log to use Timber
  • Use apply instead of commit for preference manager as this task runs asynchronously and the boolean returned by commit is not used
  • Remove redundant semi colons from Kotlin classes
  • Remove unused imports from Kotlin classes
  • Clean up XML code in Layout files

Fixes #171 Fix Lint errors/warnings

@codecov-io
Copy link

Codecov Report

Merging #2537 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2537      +/-   ##
=========================================
- Coverage    5.89%   5.89%   -0.01%     
=========================================
  Files         258     258              
  Lines       12306   12307       +1     
  Branches     1103    1103              
=========================================
  Hits          726     726              
- Misses      11521   11522       +1     
  Partials       59      59
Impacted Files Coverage Δ
...nrw/commons/upload/SimilarImageDialogFragment.java 0% <ø> (ø) ⬆️
.../free/nrw/commons/category/CategoriesRenderer.java 0% <0%> (ø) ⬆️
...w/commons/contributions/ContributionsFragment.java 0% <0%> (ø) ⬆️
...va/fr/free/nrw/commons/filepicker/PickedFiles.java 0% <0%> (ø) ⬆️
...va/fr/free/nrw/commons/utils/SwipableCardView.java 0% <0%> (ø) ⬆️
...free/nrw/commons/campaigns/CampaignsPresenter.java 0% <0%> (ø) ⬆️
...rw/commons/filepicker/FilePickerConfiguration.java 0% <0%> (ø) ⬆️
...ava/fr/free/nrw/commons/filepicker/FilePicker.java 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update de9a72d...f87bcab. Read the comment docs.

@@ -108,7 +108,7 @@ public void getCampaigns() {
}

@Override public void onError(Throwable e) {
Log.e(TAG, "could not fetch campaigns: " + e.getMessage());
Timber.tag(TAG).e("could not fetch campaigns: %s", e.getMessage());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine, but is it even better to use e(Throwable, String, ...)?

@@ -108,7 +108,7 @@ public void getCampaigns() {
}

@Override public void onError(Throwable e) {
Log.e(TAG, "could not fetch campaigns: " + e.getMessage());
Timber.tag(TAG).e("could not fetch campaigns: %s", e.getMessage());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is TAG really necessary here? I thought Timber automatically adds the class name in place of a tag. Again, this might not be something you introduced, but it would be good if we can fix it altogether.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will look in to this further and update the code.

@ronanb80 ronanb80 force-pushed the bugfix/lint-warnings branch from f87bcab to c8350ea Compare March 5, 2019 18:50
@@ -108,7 +107,7 @@ public void getCampaigns() {
}

@Override public void onError(Throwable e) {
Log.e(TAG, "could not fetch campaigns: " + e.getMessage());
Timber.e(e.getMessage(), "could not fetch campaigns");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this form the first argument needs to be Throwable. Just Timber.e(e, "could not fetch campaigns") will do the job, I believe.

@maskaravivek maskaravivek merged commit 480c05b into commons-app:master Mar 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants