From cc672d90027818b68de48d39712d63723e8edcef Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Mon, 18 Sep 2023 23:29:35 +0530 Subject: [PATCH] chore: reformat with `ktfmt` 0.45 --- .../main/java/app/passwordstore/util/git/sshj/SshKey.kt | 3 +-- .../passwordstore/util/services/OreoAutofillService.kt | 3 +-- .../autofillparser/AutofillScenario.kt | 9 +++------ .../autofillparser/AutofillStrategyDsl.kt | 3 +-- .../autofillparser/FeatureAndTrustDetection.kt | 3 +-- .../passwordstore/crypto/PGPainlessCryptoHandlerTest.kt | 1 - .../main/kotlin/app/passwordstore/ssh/SSHKeyManager.kt | 6 ++---- 7 files changed, 9 insertions(+), 19 deletions(-) diff --git a/app/src/main/java/app/passwordstore/util/git/sshj/SshKey.kt b/app/src/main/java/app/passwordstore/util/git/sshj/SshKey.kt index 2251f72b74..b72fc58b09 100644 --- a/app/src/main/java/app/passwordstore/util/git/sshj/SshKey.kt +++ b/app/src/main/java/app/passwordstore/util/git/sshj/SshKey.kt @@ -197,8 +197,7 @@ object SshKey { // Cursor returns only a single row. cursor.moveToFirst() cursor.getInt(0) - } - ?: throw IOException(context.getString(R.string.ssh_key_does_not_exist)) + } ?: throw IOException(context.getString(R.string.ssh_key_does_not_exist)) // We assume that an SSH key's ideal size is > 0 bytes && < 100 kilobytes. if (fileSize > 100_000 || fileSize == 0) diff --git a/app/src/main/java/app/passwordstore/util/services/OreoAutofillService.kt b/app/src/main/java/app/passwordstore/util/services/OreoAutofillService.kt index 608913670b..6a9cea8d29 100644 --- a/app/src/main/java/app/passwordstore/util/services/OreoAutofillService.kt +++ b/app/src/main/java/app/passwordstore/util/services/OreoAutofillService.kt @@ -165,6 +165,5 @@ fun Context.getCustomSuffixes(): Sequence { return sharedPrefs .getString(PreferenceKeys.OREO_AUTOFILL_CUSTOM_PUBLIC_SUFFIXES) ?.splitToSequence('\n') - ?.filter { it.isNotBlank() && it.first() != '.' && it.last() != '.' } - ?: emptySequence() + ?.filter { it.isNotBlank() && it.first() != '.' && it.last() != '.' } ?: emptySequence() } 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 2670a77d7b..9741904800 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 @@ -70,24 +70,21 @@ public sealed class AutofillScenario { clientState, BUNDLE_KEY_CURRENT_PASSWORD_IDS, AutofillId::class.java - ) - ?: emptyList() + ) ?: emptyList() ) newPassword.addAll( BundleCompat.getParcelableArrayList( clientState, BUNDLE_KEY_NEW_PASSWORD_IDS, AutofillId::class.java - ) - ?: emptyList() + ) ?: emptyList() ) genericPassword.addAll( BundleCompat.getParcelableArrayList( clientState, BUNDLE_KEY_GENERIC_PASSWORD_IDS, AutofillId::class.java - ) - ?: emptyList() + ) ?: emptyList() ) } .build() 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 94cef6e58d..0a75f07892 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 @@ -430,8 +430,7 @@ internal class AutofillStrategy private constructor(private val rules: List 0 bytes && < 100 kilobytes. require(fileSize in 1 until SSH_KEY_MAX_FILE_SIZE) { applicationContext.getString(R.string.ssh_key_import_error_not_an_ssh_key_message)