From e210382d828308718f704a14744fabd6cb8ef5b5 Mon Sep 17 00:00:00 2001 From: Wojtek Zieba Date: Tue, 24 Sep 2024 19:30:02 +0200 Subject: [PATCH 1/8] temp: use wip version of wordpress lint checks --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index c8b7948a04e4..e3bc8c1dabaf 100644 --- a/build.gradle +++ b/build.gradle @@ -112,7 +112,7 @@ ext { // other androidDesugarVersion = '2.1.2' - wordPressLintVersion = '2.1.0' + wordPressLintVersion = '20-b48dc8345c25641937b3c96b77079d05b0c24da3' } measureBuilds { From 47bae6b26046542652c363e4106c6ea9da8b7fd7 Mon Sep 17 00:00:00 2001 From: Wojtek Zieba Date: Fri, 1 Nov 2024 16:59:53 +0100 Subject: [PATCH 2/8] Revert "temp: use wip version of wordpress lint checks" This reverts commit e210382d828308718f704a14744fabd6cb8ef5b5. --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index e3bc8c1dabaf..c8b7948a04e4 100644 --- a/build.gradle +++ b/build.gradle @@ -112,7 +112,7 @@ ext { // other androidDesugarVersion = '2.1.2' - wordPressLintVersion = '20-b48dc8345c25641937b3c96b77079d05b0c24da3' + wordPressLintVersion = '2.1.0' } measureBuilds { From 3f5fa725a9da098bf0207448b56784af3885c1c5 Mon Sep 17 00:00:00 2001 From: Wojtek Zieba Date: Fri, 1 Nov 2024 17:04:00 +0100 Subject: [PATCH 3/8] Don't enable `UnknownNullness` lint warning We have this covered via checks from WordPress-Lint --- WordPress/build.gradle | 1 - config/lint/lint.xml | 7 ------- libs/analytics/build.gradle | 4 ---- libs/editor/build.gradle | 4 ---- libs/fluxc/build.gradle | 1 - libs/image-editor/build.gradle | 4 ---- libs/login/build.gradle | 1 - libs/mocks/build.gradle | 4 ---- libs/networking/build.gradle | 4 ---- 9 files changed, 30 deletions(-) diff --git a/WordPress/build.gradle b/WordPress/build.gradle index 6512edf6ea88..940103b392c0 100644 --- a/WordPress/build.gradle +++ b/WordPress/build.gradle @@ -303,7 +303,6 @@ android { checkGeneratedSources = true lintConfig file("${project.rootDir}/config/lint/lint.xml") baseline file("${project.rootDir}/config/lint/baseline.xml") - enable += 'UnknownNullness' sarifReport = System.getenv('CI') ? true : false } diff --git a/config/lint/lint.xml b/config/lint/lint.xml index 9297a32e3022..67c8ccbca0b6 100644 --- a/config/lint/lint.xml +++ b/config/lint/lint.xml @@ -79,13 +79,6 @@ - - - - - - - diff --git a/libs/analytics/build.gradle b/libs/analytics/build.gradle index 688498976938..e13caf9c187c 100644 --- a/libs/analytics/build.gradle +++ b/libs/analytics/build.gradle @@ -19,8 +19,4 @@ android { targetSdkVersion rootProject.targetSdkVersion compileSdk rootProject.compileSdkVersion } - - lint { - enable += 'UnknownNullness' - } } diff --git a/libs/editor/build.gradle b/libs/editor/build.gradle index 95b1b60257e6..01a7a03b3285 100644 --- a/libs/editor/build.gradle +++ b/libs/editor/build.gradle @@ -14,10 +14,6 @@ android { compileSdk rootProject.compileSdkVersion } - lint { - enable += 'UnknownNullness' - } - // Avoid 'duplicate files during packaging of APK' errors packagingOptions { exclude 'LICENSE.txt' diff --git a/libs/fluxc/build.gradle b/libs/fluxc/build.gradle index 06aa8c4e282f..f79e3c0b4419 100644 --- a/libs/fluxc/build.gradle +++ b/libs/fluxc/build.gradle @@ -30,7 +30,6 @@ android { } lint { - enable += 'UnknownNullness' disable 'UseTomlInstead', 'IgnoreWithoutReason' } diff --git a/libs/image-editor/build.gradle b/libs/image-editor/build.gradle index 760a5459ab91..cad70ab4e8c4 100644 --- a/libs/image-editor/build.gradle +++ b/libs/image-editor/build.gradle @@ -29,10 +29,6 @@ android { } } - lint { - enable += 'UnknownNullness' - } - buildFeatures { viewBinding true } diff --git a/libs/login/build.gradle b/libs/login/build.gradle index 2714346688fe..48919d7f489a 100644 --- a/libs/login/build.gradle +++ b/libs/login/build.gradle @@ -18,7 +18,6 @@ android { buildConfig true } lint { - enable += 'UnknownNullness' disable 'UseTomlInstead' } } diff --git a/libs/mocks/build.gradle b/libs/mocks/build.gradle index ae4cb6d18127..67aa2d369615 100644 --- a/libs/mocks/build.gradle +++ b/libs/mocks/build.gradle @@ -10,10 +10,6 @@ android { targetSdkVersion rootProject.targetSdkVersion compileSdk rootProject.compileSdkVersion } - - lint { - enable += 'UnknownNullness' - } } dependencies { diff --git a/libs/networking/build.gradle b/libs/networking/build.gradle index 273391eec732..153f5ce6ec59 100644 --- a/libs/networking/build.gradle +++ b/libs/networking/build.gradle @@ -10,10 +10,6 @@ android { targetSdkVersion rootProject.targetSdkVersion compileSdk rootProject.compileSdkVersion } - - lint { - enable += 'UnknownNullness' - } } dependencies { From 20cd7bda6fb734236350bcc6a25f275ba2954566 Mon Sep 17 00:00:00 2001 From: Wojtek Zieba Date: Mon, 4 Nov 2024 15:35:17 +0100 Subject: [PATCH 4/8] Disable disabling `UseTomlInstead` in `login` module --- libs/login/build.gradle | 3 --- 1 file changed, 3 deletions(-) diff --git a/libs/login/build.gradle b/libs/login/build.gradle index 48919d7f489a..6622a6246615 100644 --- a/libs/login/build.gradle +++ b/libs/login/build.gradle @@ -17,9 +17,6 @@ android { buildFeatures { buildConfig true } - lint { - disable 'UseTomlInstead' - } } dependencies { From 91934aa21ab8f31655214b82ee9e78eff6cf0160 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Nov 2024 09:01:00 +0000 Subject: [PATCH 5/8] Bump com.android.tools:desugar_jdk_libs from 2.1.2 to 2.1.3 Bumps [com.android.tools:desugar_jdk_libs](https://github.com/google/desugar_jdk_libs) from 2.1.2 to 2.1.3. - [Changelog](https://github.com/google/desugar_jdk_libs/blob/master/CHANGELOG.md) - [Commits](https://github.com/google/desugar_jdk_libs/commits) --- updated-dependencies: - dependency-name: com.android.tools:desugar_jdk_libs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c74375500793..7d15b3b1cf4b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] agp = '8.5.1' airbnb-lottie = '6.6.0' -android-desugar = '2.1.2' +android-desugar = '2.1.3' android-installreferrer = '2.2' android-security-lint = '1.0.3' android-volley = '1.2.1' From 32b261d9a28b6a891812c0f1e9dca7c188885a05 Mon Sep 17 00:00:00 2001 From: Wojtek Zieba Date: Thu, 7 Nov 2024 12:41:57 +0100 Subject: [PATCH 6/8] Use version catalog for dependencies that specify artifact type Related discussion: https://github.com/wordpress-mobile/WordPress-Android/pull/21256#discussion_r1827550283 --- gradle/libs.versions.toml | 4 ++++ libs/fluxc/build.gradle | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a1d9199e69aa..51622d2f2755 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -77,6 +77,7 @@ gutenberg-mobile = 'v1.121.0' indexos-media-for-mobile = '43a9026f0973a2f0a74fa813132f6a16f7499c3a' jackson-databind = '2.12.7.1' jetty-webapp = '9.4.51.v20230217' +jna = '5.15.0@aar' json-path = '2.9.0' jsoup = '1.18.1' junit = '4.13.2' @@ -95,6 +96,7 @@ squareup-java-poet = '1.13.0' squareup-kotlin-poet = '1.18.1' squareup-okhttp3 = '4.12.0' squareup-retrofit = '2.11.0' +terl-lazysodium-android = '5.0.2@aar' violation-comments = '1.70.0' wellsql = '2.0.0' wiremock = '2.26.3' @@ -227,6 +229,7 @@ indexos-media-for-mobile-android = { group = "com.github.indexos.media-for-mobil indexos-media-for-mobile-domain = { group = "com.github.indexos.media-for-mobile", name = "domain", version.ref = "indexos-media-for-mobile" } jackson-databind = { group = "com.fasterxml.jackson.core", name = "jackson-databind", version.ref = "jackson-databind" } jetty-webapp = { group = "org.eclipse.jetty", name = "jetty-webapp", version.ref = "jetty-webapp" } +jna = { module = "net.java.dev.jna:jna", version.ref = "jna" } json-path = { group = "com.jayway.jsonpath", name = "json-path", version.ref = "json-path" } jsoup = { group = "org.jsoup", name = "jsoup", version.ref = "jsoup" } junit = { group = "junit", name = "junit", version.ref = "junit" } @@ -250,6 +253,7 @@ squareup-kotlin-poet-main = { group = "com.squareup", name = "kotlinpoet", versi squareup-okhttp3 = { module = "com.squareup.okhttp3:okhttp", version.ref = "squareup-okhttp3" } squareup-okhttp3-urlconnection = { module = "com.squareup.okhttp3:okhttp-urlconnection", version.ref = "squareup-okhttp3" } squareup-retrofit = { group = "com.squareup.retrofit2", name = "retrofit", version.ref = "squareup-retrofit" } +terl-lazysodium-android = { module = "com.goterl:lazysodium-android", version.ref = "terl-lazysodium-android" } wellsql = { module = "org.wordpress:wellsql", version.ref = "wellsql" } wellsql-processor = { module = "org.wordpress.wellsql:wellsql-processor", version.ref = "wellsql" } wiremock = { group = "com.github.tomakehurst", name = "wiremock", version.ref = "wiremock" } diff --git a/libs/fluxc/build.gradle b/libs/fluxc/build.gradle index f79e3c0b4419..3ece7415ad3b 100644 --- a/libs/fluxc/build.gradle +++ b/libs/fluxc/build.gradle @@ -110,8 +110,8 @@ dependencies { implementation libs.kotlinx.coroutines.android // Encrypted Logging - api "com.goterl:lazysodium-android:5.0.2@aar" - api "net.java.dev.jna:jna:5.15.0@aar" + api(libs.terl.lazysodium.android.get().toString()) // TODO: https://github.com/gradle/gradle/issues/21267 + api(libs.jna.get().toString()) // TODO: https://github.com/gradle/gradle/issues/21267 // Unit tests testImplementation libs.junit From d89ed5e9c73349792d9d82f98b63eb855cbaae16 Mon Sep 17 00:00:00 2001 From: Wojtek Zieba Date: Thu, 7 Nov 2024 12:42:28 +0100 Subject: [PATCH 7/8] Remove `UseTomlInstead` from disabled lint rules --- libs/fluxc/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/fluxc/build.gradle b/libs/fluxc/build.gradle index 3ece7415ad3b..3a9207677cee 100644 --- a/libs/fluxc/build.gradle +++ b/libs/fluxc/build.gradle @@ -30,7 +30,7 @@ android { } lint { - disable 'UseTomlInstead', 'IgnoreWithoutReason' + disable 'IgnoreWithoutReason' } testOptions { From 94773c7c4d53233ce385f59fb6dbebb23c3ba25e Mon Sep 17 00:00:00 2001 From: Wojtek Zieba Date: Thu, 7 Nov 2024 12:51:14 +0100 Subject: [PATCH 8/8] Remove `IgnoreWithoutReason` from disabled lint rules Suppress this warning on imported tests that are breaking this rule --- libs/fluxc/build.gradle | 4 ---- .../java/org/wordpress/android/fluxc/store/StatsStoreTest.kt | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/libs/fluxc/build.gradle b/libs/fluxc/build.gradle index 3a9207677cee..011dadcec118 100644 --- a/libs/fluxc/build.gradle +++ b/libs/fluxc/build.gradle @@ -29,10 +29,6 @@ android { consumerProguardFiles 'consumer-rules.pro' } - lint { - disable 'IgnoreWithoutReason' - } - testOptions { unitTests.includeAndroidResources = true } diff --git a/libs/fluxc/src/test/java/org/wordpress/android/fluxc/store/StatsStoreTest.kt b/libs/fluxc/src/test/java/org/wordpress/android/fluxc/store/StatsStoreTest.kt index 5e6d8c304aac..d0aa82529167 100644 --- a/libs/fluxc/src/test/java/org/wordpress/android/fluxc/store/StatsStoreTest.kt +++ b/libs/fluxc/src/test/java/org/wordpress/android/fluxc/store/StatsStoreTest.kt @@ -172,6 +172,7 @@ class StatsStoreTest { } @Test @Ignore + @Suppress("IgnoreWithoutReason") fun `insight types starts with news type and ends with control type when news card was not shown`() = test { whenever(insightTypesSqlUtils.selectAddedItemsOrderedByStatus(site)).thenReturn(listOf(COMMENTS)) whenever(sharedPreferences.getBoolean(INSIGHTS_MANAGEMENT_NEWS_CARD_SHOWN, false)).thenReturn(false) @@ -185,6 +186,7 @@ class StatsStoreTest { } @Test @Ignore + @Suppress("IgnoreWithoutReason") fun `insight types does not start with news type when news card was shown`() = test { whenever(insightTypesSqlUtils.selectAddedItemsOrderedByStatus(site)).thenReturn(listOf(COMMENTS)) whenever(sharedPreferences.getBoolean(INSIGHTS_MANAGEMENT_NEWS_CARD_SHOWN, false)).thenReturn(true)