From 9f70c155d073693761da597b79a7df27c7e3afb6 Mon Sep 17 00:00:00 2001 From: Petros Paraskevopoulos Date: Thu, 31 Aug 2023 15:03:42 +0300 Subject: [PATCH 1/4] Analysis: Remove unused lint xml file from fluxc module 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. --- fluxc/lint.xml | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 fluxc/lint.xml diff --git a/fluxc/lint.xml b/fluxc/lint.xml deleted file mode 100644 index 8977c5c43f..0000000000 --- a/fluxc/lint.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - From 60da5f628f255ffc9c840075ace40ee08d5d2e74 Mon Sep 17 00:00:00 2001 From: Petros Paraskevopoulos Date: Thu, 31 Aug 2023 15:09:38 +0300 Subject: [PATCH 2/4] Analysis: Remove unnecessary lint configuration for example module 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: 78b37f9856bd3b2ed7a30f420885c22afab13cd0 --- example/build.gradle | 4 ---- 1 file changed, 4 deletions(-) diff --git a/example/build.gradle b/example/build.gradle index d8f19d5ee6..6235e0b53b 100644 --- a/example/build.gradle +++ b/example/build.gradle @@ -44,10 +44,6 @@ android { } } - lint { - warning 'InvalidPackage' - } - testOptions { // Don't use the test orchestrator yet, some of our connected testsare sharing state to reduce network // pressure on the API (authentication/fetch profile/fetch sites). From 6c46c8dd4c2276922f8a12b3a8297cdb54a95141 Mon Sep 17 00:00:00 2001 From: Petros Paraskevopoulos Date: Thu, 31 Aug 2023 15:31:40 +0300 Subject: [PATCH 3/4] Build: Enable unknown nullness lint check for the whole project 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 --- example/build.gradle | 4 ++++ fluxc/build.gradle | 5 +++++ plugins/woocommerce/build.gradle | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/example/build.gradle b/example/build.gradle index 6235e0b53b..45beed4e91 100644 --- a/example/build.gradle +++ b/example/build.gradle @@ -59,6 +59,10 @@ android { } } + lint { + enable += 'UnknownNullness' + } + buildFeatures { buildConfig true viewBinding true diff --git a/fluxc/build.gradle b/fluxc/build.gradle index 456795067a..50aeaab287 100644 --- a/fluxc/build.gradle +++ b/fluxc/build.gradle @@ -26,6 +26,7 @@ android { } consumerProguardFiles 'proguard-rules.pro' } + buildTypes { release { minifyEnabled false @@ -33,6 +34,10 @@ android { } } + lint { + enable += 'UnknownNullness' + } + testOptions { unitTests.includeAndroidResources = true } diff --git a/plugins/woocommerce/build.gradle b/plugins/woocommerce/build.gradle index aeedc4923a..5792f65ded 100644 --- a/plugins/woocommerce/build.gradle +++ b/plugins/woocommerce/build.gradle @@ -24,6 +24,7 @@ android { } testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } + buildTypes { release { minifyEnabled false @@ -31,6 +32,10 @@ android { } } + lint { + enable += 'UnknownNullness' + } + sourceSets { main.java.srcDirs += 'src/main/kotlin' androidTest.assets.srcDirs += files("$projectDir/schemas".toString()) From b7ca887737be7b390901e24e553dc3d825cb5d0f Mon Sep 17 00:00:00 2001 From: Petros Paraskevopoulos Date: Thu, 31 Aug 2023 15:37:21 +0300 Subject: [PATCH 4/4] Analysis: Change unknown nullness severity to informational 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. --- config/lint/lint.xml | 5 +++++ example/build.gradle | 1 + fluxc/build.gradle | 1 + plugins/woocommerce/build.gradle | 1 + 4 files changed, 8 insertions(+) create mode 100644 config/lint/lint.xml diff --git a/config/lint/lint.xml b/config/lint/lint.xml new file mode 100644 index 0000000000..ddb2d9d6f4 --- /dev/null +++ b/config/lint/lint.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/example/build.gradle b/example/build.gradle index 45beed4e91..c57710ae63 100644 --- a/example/build.gradle +++ b/example/build.gradle @@ -60,6 +60,7 @@ android { } lint { + lintConfig file("${project.rootDir}/config/lint/lint.xml") enable += 'UnknownNullness' } diff --git a/fluxc/build.gradle b/fluxc/build.gradle index 50aeaab287..9c424cc0f4 100644 --- a/fluxc/build.gradle +++ b/fluxc/build.gradle @@ -35,6 +35,7 @@ android { } lint { + lintConfig file("${project.rootDir}/config/lint/lint.xml") enable += 'UnknownNullness' } diff --git a/plugins/woocommerce/build.gradle b/plugins/woocommerce/build.gradle index 5792f65ded..3e243604ff 100644 --- a/plugins/woocommerce/build.gradle +++ b/plugins/woocommerce/build.gradle @@ -33,6 +33,7 @@ android { } lint { + lintConfig file("${project.rootDir}/config/lint/lint.xml") enable += 'UnknownNullness' }