Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
chore: reformat with ktfmt 0.45
Browse files Browse the repository at this point in the history
  • Loading branch information
msfjarvis committed Sep 18, 2023
1 parent 4a1f5ca commit 9dadbd4
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 19 deletions.
3 changes: 1 addition & 2 deletions app/src/main/java/app/passwordstore/util/git/sshj/SshKey.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,5 @@ fun Context.getCustomSuffixes(): Sequence<String> {
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()
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,24 +70,21 @@ public sealed class AutofillScenario<out T : Any> {
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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,7 @@ internal class AutofillStrategy private constructor(private val rules: List<Auto
possibleOtpFields,
singleOriginMode = singleOriginMode,
isManualRequest = isManualRequest
)
?: continue
) ?: continue
}
return null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,7 @@ private fun getBrowserAutofillSupportLevel(
// browsers here.
supportLevel != BrowserAutofillSupportLevel.GeneralFillAndSave &&
Build.VERSION.SDK_INT < Build.VERSION_CODES.P
}
?: BrowserAutofillSupportLevel.None
} ?: BrowserAutofillSupportLevel.None
}

@RequiresApi(Build.VERSION_CODES.O)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
@file:Suppress("JUnitMalformedDeclaration") // The test runner takes care of it

package app.passwordstore.crypto

import app.passwordstore.crypto.CryptoConstants.KEY_PASSPHRASE
Expand Down
6 changes: 2 additions & 4 deletions ssh/src/main/kotlin/app/passwordstore/ssh/SSHKeyManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ public class SSHKeyManager(private val applicationContext: Context) {
private fun keyType(): SSHKeyType {
return SSHKeyType.fromValue(
applicationContext.sharedPrefs.getString(Constants.GIT_REMOTE_KEY_TYPE, null)
)
?: throw NullKeyException()
) ?: throw NullKeyException()
}

public fun keyExists(): Boolean {
Expand Down Expand Up @@ -121,8 +120,7 @@ public class SSHKeyManager(private val applicationContext: Context) {
// Cursor returns only a single row.
cursor.moveToFirst()
cursor.getInt(0)
}
?: throw IOException(applicationContext.getString(R.string.ssh_key_does_not_exist))
} ?: throw IOException(applicationContext.getString(R.string.ssh_key_does_not_exist))
// We assume that an SSH key's ideal size is > 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)
Expand Down

0 comments on commit 9dadbd4

Please sign in to comment.