Conversation
Warning Message: "WRITE_EXTERNAL_STORAGE no longer provides write access when targeting Android 11+, even when using 'requestLegacyExternalStorage'" Explanation: "Scoped storage is enforced on Android 10+ (or Android 11+ if using requestLegacyExternalStorage). In particular, WRITE_EXTERNAL_STORAGE will no longer provide write access to all files; it will provide the equivalent of READ_EXTERNAL_STORAGE instead." ------------------------------------------------------------------------ This warning is already addressed and will be fixed as part of the ongoing Android 13 media permissions work (see PR below): PR: #18183
Warning Message: "'<uses-permission>' tag appears after '<application>' tag" Explanation: "The <application> tag should appear after the elements which declare which version you need, which features you need, which libraries you need, and so on. In the past there have been subtle bugs (such as themes not getting applied correctly) when the <application> tag appears before some of these other elements, so it's best to order your manifest in the logical dependency order." ------------------------------------------------------------------------ Reordering the '<application>' and moving it after the '<uses-permission>' tags fixes this warning.
Warning Message: "You should set an icon for the application as whole because there is no default. This attribute must be set as a reference to a drawable resource containing the image (for example @drawable/icon)." ------------------------------------------------------------------------ Suppress this warning for the 'debug' source set should be enough for the time being.
Warning Message: "Exported content providers can provide access to potentially sensitive data" Explanation: "Content providers are exported by default and any application on the system can potentially use them to read and write data. If the content provider provides access to sensitive data, it should be protected by specifying export=false in the manifest or by protecting it with a permission that can be granted to other applications." ------------------------------------------------------------------------ This exported content provider was added as part of dc7ba56 in order to enable content migration from WordPress to Jetpack. The migration is currently still in-progress (ish) so suppressing this for the the time being and at least until the migration is fully complete.
Warning Message: "Very long vector path (X characters), which is bad for performance. Considering reducing precision, removing minor details or rasterizing vector." Explanation: "Using long vector paths is bad for performance. There are several ways to make the pathData shorter: * Using less precision * Removing some minor details * Using the Android Studio vector conversion tool * Rasterizing the image (converting to PNG)" ------------------------------------------------------------------------ As per the suggestions above, there are several ways to make the 'pathData' shorter. But, this is either requiring some additional design help/work and then some extra testing too. As such, suppressing these warnings, and as closer to source (pathData) as possible, should be enough for the time being. Later on, per 'pathData' and specific set of vector designs, an engineer could closely collaborate with a designer to start updating those with newer designs, one-by-one, and then test for correctness before merging that change.
Warning Messages:
- "The locale folder "'he'" should be called "'iw'" instead; see the
'java.util.Locale' documentation"
- "The locale folder "'id'" should be called "'in'" instead; see the
'java.util.Locale' documentation"
Explanation: "From the java.util.Locale documentation:
"Note that Java uses several deprecated two-letter codes. The Hebrew
("he") language code is rewritten as "iw", Indonesian ("id") as "in",
and Yiddish ("yi") as "ji". This rewriting happens even if you construct
your own Locale object, not just for instances returned by the various
lookup methods.
Because of this, if you add your localized resources in for example
values-he they will not be used, since the system will look for
values-iw instead.
To work around this, place your resources in a values folder using the
deprecated language code instead."
------------------------------------------------------------------------
This Lint warning is moved within lint config and removed from Lint's
baseline because in order to resolve this warning a similar release
management localization solution should be set-up for the Jetpack app,
just like it is already done on the WordPress app.
Related: Lint Warnings - Resolve 'LocaleFolder'
- #18226
Warning Message: "Consider splitting data tag into multiple tags with
individual attributes to avoid confusion"
Explanation: "<intent-filter> <data> tags should only declare a single
unique attribute (i.e. scheme OR host, but not both). This better
matches the runtime behavior of intent filters, as they combine all of
the declared data attributes into a single matcher which is allowed to
handle any combination across attribute types.
For example, the following two <intent-filter> declarations are the
same:
<intent-filter>
<data android:scheme="http" android:host="example.com" />
<data android:scheme="https" android:host="example.org" />
</intent-filter>
<intent-filter>
<data android:scheme="http"/>
<data android:scheme="https"/>
<data android:host="example.com" />
<data android:host="example.org" />
</intent-filter>
They both handle all of the following:
* http://example.com
* https://example.com
* http://example.org
* https://example.org
The second one better communicates the combining behavior and is clearer
to an external reader that one should not rely on the scheme/host being
self contained. It is not obvious in the first that http://example.org
is also matched, which can lead to confusion (or incorrect behavior)
with a more complex set of schemes/hosts.
Note that this does not apply to host + port, as those must be declared
in the same <data> tag and are only associated with each other."
------------------------------------------------------------------------
Splitting the data tags into one 'scheme' tag (for 'jetpack') and
multiple 'host' tags (for 'viewpost', 'stats', 'read', 'post',
'notifications' and 'home') with individual attributes fixes these
warnings.
Warning Message: "You should set an icon for the application as whole because there is no default. This attribute must be set as a reference to a drawable resource containing the image (for example @drawable/icon)." ------------------------------------------------------------------------ Suppress this warning for the 'jetpack' source set should be enough for the time being.
Warning Message: "Modifier parameter should be the first optional parameter" Explanation: "The first (or only) Modifier parameter in a Composable function should follow the following rules: - Be named modifier - Have a type of Modifier - Either have no default value, or have a default value of Modifier - If optional, be the first optional parameter in the parameter list" ------------------------------------------------------------------------ Reordering the 'modifier' parameter and moving it to become the first optional parameter on the 'RepeatingColumn' composable function fixes this warning.
Since there is no longer any other source set related section left within the 'baseline.xml' configuration file, removing the only one such remaining 'main' source set section is preferred to make this Lint baseline file more straightforward and completely auto-generated.
9 tasks
Contributor
|
| App Name | Jetpack |
|
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr18227-16c22e4 | |
| Commit | 16c22e4 | |
| Direct Download | jetpack-prototype-build-pr18227-16c22e4.apk |
Contributor
|
| App Name | WordPress |
|
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr18227-16c22e4 | |
| Commit | 16c22e4 | |
| Direct Download | wordpress-prototype-build-pr18227-16c22e4.apk |
ovitrif
approved these changes
Apr 6, 2023
Contributor
ovitrif
left a comment
There was a problem hiding this comment.
Thank you for this awesome cleanup work @ParaskP7 🙇🏻
I tested the functionality that might have been affected by commit 1117296 using my public codepen: WP Deep Links Helper. All links worked as expected in the JP app 🎉
I left a small np comment on composables params ordering, but feel free to ignore it if you don't 💯 agree, and
🚀
...Press/src/jetpack/java/org/wordpress/android/ui/accounts/login/components/RepeatingColumn.kt
Outdated
Show resolved
Hide resolved
… into analysis/resolve-debug-wordpress-jetpack-lint-warnings
Contributor
Author
|
Thank you so much for the review and testing @ovitrif , you are awesome! 🙇 ❤️ 🚀
🎉 Thank YOU! 🙇 x 💯 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Parent #18162
Closes #18192
This PR resolves all Lint related warnings for the
Debug,WordPressandJetpacksource sets:Reconfigure Lint (Ignore):
Warnings Resolution List:
Warnings Suppression List:
Documentation List:
PS: @ovitrif I added you as the main reviewer, randomly, since I just wanted someone from the WordPress team to be aware of and sign-off on that change for WPAndroid. I also added the @wordpress-mobile/apps-infrastructure team, but this in done only for monitoring purposes, as such, I am not expecting any active review from that team. Thus, feel free to merge this PR if you deem so.
To test:
FYI: As far as I can tell, the only commit that might cause some behavior change might be this 1117296 commit. Thus, you might want to check this one out in a bit more detail/depth. Everything else shouldn't cause any trouble.
Regression Notes
Potential unintended areas of impact
<intent-filter>functionality onDeepLinkingIntentReceiverActivityand itsandroid.intent.action.VIEWaction (see 1117296 commit).What I did to test those areas of impact (or what existing automated tests I relied on)
To testsection above.What automated tests I added (or what prevented me from doing so)
PR submission checklist:
RELEASE-NOTES.txtif necessary.