Skip to content

Commit 0fe0421

Browse files
authored
Merge pull request #21256 from wordpress-mobile/bump_android_lint
Merge some of the WordPress lint rules, to reduce number of reported issues
2 parents 0d67ee1 + ffb9840 commit 0fe0421

File tree

11 files changed

+8
-39
lines changed

11 files changed

+8
-39
lines changed

WordPress/build.gradle

-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ android {
299299
checkGeneratedSources = true
300300
lintConfig file("${project.rootDir}/config/lint/lint.xml")
301301
baseline file("${project.rootDir}/config/lint/baseline.xml")
302-
enable += 'UnknownNullness'
303302
sarifReport = System.getenv('CI') ? true : false
304303
}
305304

config/lint/lint.xml

-7
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,6 @@
7878
</issue>
7979
<issue id="IconDensities" severity="warning" /> <!-- fluxc-->
8080
<!-- INTEROPERABILITY -->
81-
<issue id="UnknownNullness" severity="informational">
82-
<ignore path="**/generated/**" />
83-
</issue>
84-
8581
<!-- TODO: https://github.com/wordpress-mobile/WordPress-Android/issues/21065 -->
8682
<issue id="UsingMaterialAndMaterial3Libraries" severity="warning" />
87-
<!-- We rely on more granural checks from WordPress-Lint-Android -->
88-
<issue id="UnknownNullness" severity="ignore" />
89-
9083
</lint>

gradle/libs.versions.toml

+4
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ gutenberg-mobile = 'v1.121.0'
7777
indexos-media-for-mobile = '43a9026f0973a2f0a74fa813132f6a16f7499c3a'
7878
jackson-databind = '2.12.7.1'
7979
jetty-webapp = '9.4.51.v20230217'
80+
jna = '5.15.0@aar'
8081
json-path = '2.9.0'
8182
jsoup = '1.18.1'
8283
junit = '4.13.2'
@@ -95,6 +96,7 @@ squareup-java-poet = '1.13.0'
9596
squareup-kotlin-poet = '1.18.1'
9697
squareup-okhttp3 = '4.12.0'
9798
squareup-retrofit = '2.11.0'
99+
terl-lazysodium-android = '5.0.2@aar'
98100
wellsql = '2.0.0'
99101
wiremock = '2.26.3'
100102
wordpress-aztec = 'v2.1.4'
@@ -226,6 +228,7 @@ indexos-media-for-mobile-android = { group = "com.github.indexos.media-for-mobil
226228
indexos-media-for-mobile-domain = { group = "com.github.indexos.media-for-mobile", name = "domain", version.ref = "indexos-media-for-mobile" }
227229
jackson-databind = { group = "com.fasterxml.jackson.core", name = "jackson-databind", version.ref = "jackson-databind" }
228230
jetty-webapp = { group = "org.eclipse.jetty", name = "jetty-webapp", version.ref = "jetty-webapp" }
231+
jna = { module = "net.java.dev.jna:jna", version.ref = "jna" }
229232
json-path = { group = "com.jayway.jsonpath", name = "json-path", version.ref = "json-path" }
230233
jsoup = { group = "org.jsoup", name = "jsoup", version.ref = "jsoup" }
231234
junit = { group = "junit", name = "junit", version.ref = "junit" }
@@ -249,6 +252,7 @@ squareup-kotlin-poet-main = { group = "com.squareup", name = "kotlinpoet", versi
249252
squareup-okhttp3 = { module = "com.squareup.okhttp3:okhttp", version.ref = "squareup-okhttp3" }
250253
squareup-okhttp3-urlconnection = { module = "com.squareup.okhttp3:okhttp-urlconnection", version.ref = "squareup-okhttp3" }
251254
squareup-retrofit = { group = "com.squareup.retrofit2", name = "retrofit", version.ref = "squareup-retrofit" }
255+
terl-lazysodium-android = { module = "com.goterl:lazysodium-android", version.ref = "terl-lazysodium-android" }
252256
wellsql = { module = "org.wordpress:wellsql", version.ref = "wellsql" }
253257
wellsql-processor = { module = "org.wordpress.wellsql:wellsql-processor", version.ref = "wellsql" }
254258
wiremock = { group = "com.github.tomakehurst", name = "wiremock", version.ref = "wiremock" }

libs/analytics/build.gradle

-4
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,4 @@ android {
1919
targetSdkVersion rootProject.targetSdkVersion
2020
compileSdk rootProject.compileSdkVersion
2121
}
22-
23-
lint {
24-
enable += 'UnknownNullness'
25-
}
2622
}

libs/editor/build.gradle

-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ android {
1414
compileSdk rootProject.compileSdkVersion
1515
}
1616

17-
lint {
18-
enable += 'UnknownNullness'
19-
}
20-
2117
// Avoid 'duplicate files during packaging of APK' errors
2218
packagingOptions {
2319
exclude 'LICENSE.txt'

libs/fluxc/build.gradle

+2-7
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ android {
2525
consumerProguardFiles 'consumer-rules.pro'
2626
}
2727

28-
lint {
29-
enable += 'UnknownNullness'
30-
disable 'UseTomlInstead', 'IgnoreWithoutReason'
31-
}
32-
3328
testOptions {
3429
unitTests.includeAndroidResources = true
3530
}
@@ -107,8 +102,8 @@ dependencies {
107102
implementation libs.kotlinx.coroutines.android
108103

109104
// Encrypted Logging
110-
api "com.goterl:lazysodium-android:5.0.2@aar"
111-
api "net.java.dev.jna:jna:5.15.0@aar"
105+
api(libs.terl.lazysodium.android.get().toString()) // TODO: https://github.com/gradle/gradle/issues/21267
106+
api(libs.jna.get().toString()) // TODO: https://github.com/gradle/gradle/issues/21267
112107

113108
// Unit tests
114109
testImplementation libs.junit

libs/fluxc/src/test/java/org/wordpress/android/fluxc/store/StatsStoreTest.kt

+2
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ class StatsStoreTest {
172172
}
173173

174174
@Test @Ignore
175+
@Suppress("IgnoreWithoutReason")
175176
fun `insight types starts with news type and ends with control type when news card was not shown`() = test {
176177
whenever(insightTypesSqlUtils.selectAddedItemsOrderedByStatus(site)).thenReturn(listOf(COMMENTS))
177178
whenever(sharedPreferences.getBoolean(INSIGHTS_MANAGEMENT_NEWS_CARD_SHOWN, false)).thenReturn(false)
@@ -185,6 +186,7 @@ class StatsStoreTest {
185186
}
186187

187188
@Test @Ignore
189+
@Suppress("IgnoreWithoutReason")
188190
fun `insight types does not start with news type when news card was shown`() = test {
189191
whenever(insightTypesSqlUtils.selectAddedItemsOrderedByStatus(site)).thenReturn(listOf(COMMENTS))
190192
whenever(sharedPreferences.getBoolean(INSIGHTS_MANAGEMENT_NEWS_CARD_SHOWN, false)).thenReturn(true)

libs/image-editor/build.gradle

-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ android {
2929
}
3030
}
3131

32-
lint {
33-
enable += 'UnknownNullness'
34-
}
35-
3632
buildFeatures {
3733
viewBinding true
3834
}

libs/login/build.gradle

-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ android {
1616
buildFeatures {
1717
buildConfig true
1818
}
19-
lint {
20-
enable += 'UnknownNullness'
21-
disable 'UseTomlInstead'
22-
}
2319
}
2420

2521
dependencies {

libs/mocks/build.gradle

-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ android {
1010
targetSdkVersion rootProject.targetSdkVersion
1111
compileSdk rootProject.compileSdkVersion
1212
}
13-
14-
lint {
15-
enable += 'UnknownNullness'
16-
}
1713
}
1814

1915
dependencies {

libs/networking/build.gradle

-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ android {
1010
targetSdkVersion rootProject.targetSdkVersion
1111
compileSdk rootProject.compileSdkVersion
1212
}
13-
14-
lint {
15-
enable += 'UnknownNullness'
16-
}
1713
}
1814

1915
dependencies {

0 commit comments

Comments
 (0)