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
Fixing Gradle 5.4.1 lint errors #10593
Fixing Gradle 5.4.1 lint errors #10593
Conversation
You can test the changes on this Pull Request by downloading the APK here. |
@malinajirka Replying this comment here:
It might be better to try to use the
Yeah, it looks like we have it suppressed there 🤔 Maybe we need to change the
I've attempted to fix DefaultLocale in 41593d6, however I've created a PR in FluxC to fix the DiffUtilEquals issue. wordpress-mobile/WordPress-FluxC-Android#1398 I am going to take a break from this PR for today and work on something more useful 😩 |
Sure, we can give it a try - I'd just suggest using SparseArrayCompat which will behave the same on all version of Android.
I wouldn't create issues for them as imho they are not worth fixing - they are all over the place. I added them to the baseline and increased the severity to error so no-one ever introduces this issue again, but I wasn't planning on fixing them.
Yep, I'd try to add them to the baseline again - perhaps the syntax has changed a bit and that's why the suppression doesn't work.
I'll look into it. |
WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/DateUtils.kt
Outdated
Show resolved
Hide resolved
2be5d2d
to
eb8a8f7
Compare
I've added
I was actually thinking a single issue with maybe a checklist or something. I am not sure if I agree with they are not worth fixing, but I can see us not being able to work on them unless someone picks it up during a hack week.
Thank you! I think these 2 are the only remaining bits except for the |
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've added SparseArrayCompat and androidx version of LongSparseArray in 1febc41.
👍
I was actually thinking a single issue with maybe a checklist or something. I am not sure if I agree with they are not worth fixing, but I can see us not being able to work on them unless someone picks it up during a hack week.
What I meant by "they are not worth fixing" was that they are not straight-forward fixes and the cost of fixing those issues might out-weight the benefits of fixing them. However, I like having a single issue with a list which we can fix during a hack week or something 👍.
I looked into the issue with lint-baseline.xml and fixed it in issue/gradle-5-lint-errors-static-field-leak
(I didn't want to commit changes into your branch, but feel to merge them) -> the only issues remaining in that branch are "equals" and "capitalize".
I've quickly tested SiteCreation, PostList + Upload, PagesList and Stats => Everything seems to be working as expected. Feel free to merge this PR when you fix/suppress the remaining issues.
Regarding the #10583 and wordpress-mobile/WordPress-FluxC-Android#1397 PRs -> since I tested this PR I don't think it makes sense to test it again after the merge. However, I'd feel safer if someone from the Gutenberg team verified that the changes don't break their flow. Other than that I think they are ready to be merged (btw I pinged Gutenberg mobile team).
P.S. Good job fixing all the issues and upgrading the gradle version ;)!!!
String.capitalize(Locale) call crates a lint error claiming that the default locale usage is a source of bugs. This should not happen when we are already passing a locale to it. In order to get around this issue, a wrapper extension method is introduced so we can suppress the lint warning in a single place, document the reason for it and make it easy to remove it in the future.
@malinajirka Thank you for taking care of this! I cherry-picked your commit into this branch and deleted the remote branch. I've fixed the equals issue by manually implementing an equals. I thought a lot about just suppressing the issue, however in some ways the lint is right. If we suppress the error, it'll also suppress if there is a legitimate reason for it. Consider the case where we add one more subclass to that I've suppressed the default locale error for the I'd feel better if you review these 2 commits before we merge it. I'd also like to wait until we figure out the Gutenberg issue in the main branch so we can merge all of them at once. If there are any more lint issues, it'd be better to fix them here and if there are other issues it'd be better to fix them in the main branch so it's easier to review/test changes. @malinajirka Thank you for all your help and the reviews! 🙇 |
👍 Your explanation makes a lot of sense and this is a great solution! Thank you
👍 perfect!
The new changes look great;). As you mentioned lets wait until we figure out the Gutenberg issue. |
Merging this approved PR to get #10583 ready since we addressed all the remaining issues for the Gradle upgrade. |
This is a draft PR which attempts to fix the lint errors caused by the Gradle 5.4.1 upgrade in #10583. I've decided to separate this into its own PR so it's easier to discuss the changes and work together on them. It also makes it clearer what's holding up the Gradle upgrade.
To test:
We'll probably need to briefly go through changed screens, it's hard to say before the PR is complete especially since it's related to lint issues.
PR submission checklist:
RELEASE-NOTES.txt
if necessary.