-
Notifications
You must be signed in to change notification settings - Fork 37
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
[Nullability Annotations to Java Classes] Enable and Configure UnknownNullness
Android Lint Check
#2823
Conversation
It doesn't seem that this 'lint.xml' file is being within the 'fluxc' module, or anywhere for that matter. Thus, this is now being removed so as to avoid having to worry about this unused file, thinking that it has some kind of effect on this project's current Lint configuration.
It doesn't seem that this Lint related warning configuration for the 'InvalidPackage' check is necessary for the 'example' module. It is better to remove that and have Lint being configured as straightforward as possible. FYI: This unnecessary Lint configuration was added as part of this very first commit on this repo back on October 27th, 2015: 78b37f9
With that change the extra interop related 'UnknownNullness' Android Lint check gets enabled, which helps detect and flag some of the nullability interoperability issues for this project. For more info see: - Docs: https://developer.android.com/kotlin/interop#supported_checks - Check: https://googlesamples.github.io/android-custom-lint-rules/ checks/UnknownNullness.md.html
The default severity for 'UnknownNullness' is 'Warning'. This change updates that to 'Informational'. This is done in order to treat this kind of warnings as informational only, a light typo like of a warning in AS.
UnknownNullness
Android Lint Check
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.
Nice! This is working as well for me. Similar to the WordPress-Android, the informational highlights did not show up in the editor until enabling them with an extra setting (similar to what is described here: wordpress-mobile/WordPress-Android#19116 (review)):
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
index 4e2b427ce..4e4b694ab 100644
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -1,6 +1,7 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
+ <inspection_tool class="AndroidLintUnknownNullness" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="ClassName" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<scope name="Tests" level="INFORMATION" enabled="true" />
</inspection_tool>
Feel free to merge as is, or if it makes sense, include this config as well. 🤷♂️
👋 @mkevins and thanks for the review! 🙇 ❤️ 🚀
Same response. 😊 |
As discussed on the similar WordPress-Android PR, no need to change any |
Awesome @mkevins , once more thanks for the excellent review and for always sharing great suggestions! 🥇 |
Parent #2795
Closes #2822
This PR enabled and configures the extra interop related
UnknownNullness
Android Lint check to help detect and flag some of the nullability related interoperability issues, that is, issues in Java for Kotlin consumption.For more info see:
To test:
Interoperability:Kotlin Interoperability
related section on the Lint report is shown and reporting some few thousand of warnings (fluxc + plugins:woocommerce + example).fluxc
+debug
variant, I got2152
such warnings, configured to be informational only so that they don't fail the build, see screenshot below: