From 47d65d074078490b3694f305ad8badc73188dfbc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 27 Sep 2023 18:45:59 +0000 Subject: fix(deps): update dependency com.slack.lint:slack-lint-checks to v0.6.0 (#2697) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Harsh Shandilya --- autofill-parser/lint-baseline.xml | 2 +- .../androidpasswordstore/autofillparser/AutofillFormParser.kt | 2 +- .../androidpasswordstore/autofillparser/AutofillScenario.kt | 4 +++- .../androidpasswordstore/autofillparser/AutofillStrategyDsl.kt | 8 ++++++-- .../components/lib/publicsuffixlist/PublicSuffixListLoaderTest.kt | 8 ++++---- 5 files changed, 15 insertions(+), 9 deletions(-) (limited to 'autofill-parser') diff --git a/autofill-parser/lint-baseline.xml b/autofill-parser/lint-baseline.xml index 8d55468b..1f0a317f 100644 --- a/autofill-parser/lint-baseline.xml +++ b/autofill-parser/lint-baseline.xml @@ -1,4 +1,4 @@ - + diff --git a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillFormParser.kt b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillFormParser.kt index 6a8e16f3..badaabcb 100644 --- a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillFormParser.kt +++ b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillFormParser.kt @@ -116,7 +116,7 @@ private class AutofillFormParser( if (trustedBrowserInfo?.multiOriginMethod == BrowserMultiOriginMethod.WebView) { FormField(node, fieldIndex, true, inheritedWebOrigin) } else { - check(inheritedWebOrigin == null) + check(inheritedWebOrigin == null) { "'inheritedWebOrigin' should be null here" } FormField(node, fieldIndex, false) } if (field.relevantField) { diff --git a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillScenario.kt b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillScenario.kt index 97419048..c7bd99fc 100644 --- a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillScenario.kt +++ b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillScenario.kt @@ -105,7 +105,9 @@ public sealed class AutofillScenario { val genericPassword = mutableListOf() fun build(): AutofillScenario { - require(genericPassword.isEmpty() || (currentPassword.isEmpty() && newPassword.isEmpty())) + require(genericPassword.isEmpty() || (currentPassword.isEmpty() && newPassword.isEmpty())) { + "Password requirements failed." + } return if (currentPassword.isNotEmpty() || newPassword.isNotEmpty()) { ClassifiedAutofillScenario( username = username, diff --git a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillStrategyDsl.kt b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillStrategyDsl.kt index 0a75f078..04e8d98c 100644 --- a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillStrategyDsl.kt +++ b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillStrategyDsl.kt @@ -357,13 +357,17 @@ private constructor( logcat { "$name: Matched $type" } when (type) { FillableFieldType.Username -> { - check(matchResult.size == 1 && scenarioBuilder.username == null) + check(matchResult.size == 1 && scenarioBuilder.username == null) { + "Scenario has existing username or too many matches" + } scenarioBuilder.username = matchResult.single() // Hidden username fields should be saved but not filled. scenarioBuilder.fillUsername = scenarioBuilder.username!!.isVisible == true } FillableFieldType.Otp -> { - check(matchResult.size == 1 && scenarioBuilder.otp == null) + check(matchResult.size == 1 && scenarioBuilder.otp == null) { + "Scenario has existing OTP or too many matches" + } scenarioBuilder.otp = matchResult.single() } FillableFieldType.CurrentPassword -> scenarioBuilder.currentPassword.addAll(matchResult) diff --git a/autofill-parser/src/test/kotlin/mozilla/components/lib/publicsuffixlist/PublicSuffixListLoaderTest.kt b/autofill-parser/src/test/kotlin/mozilla/components/lib/publicsuffixlist/PublicSuffixListLoaderTest.kt index 0ee72880..f48759bb 100644 --- a/autofill-parser/src/test/kotlin/mozilla/components/lib/publicsuffixlist/PublicSuffixListLoaderTest.kt +++ b/autofill-parser/src/test/kotlin/mozilla/components/lib/publicsuffixlist/PublicSuffixListLoaderTest.kt @@ -10,9 +10,9 @@ import kotlin.test.Test class PublicSuffixListLoaderTest { @Test fun testLoadingBundledPublicSuffixList() { - requireNotNull(javaClass.classLoader).getResourceAsStream("publicsuffixes").buffered().use { - stream -> - PublicSuffixListLoader.load(stream) - } + requireNotNull(javaClass.classLoader) { "Null classloader????" } + .getResourceAsStream("publicsuffixes") + .buffered() + .use { stream -> PublicSuffixListLoader.load(stream) } } } -- cgit v1.2.3