chore: Linting
All checks were successful
Deploy snapshot builds / deploy-release-snapshot (push) Successful in 17m31s

This commit is contained in:
Kumi 2025-03-26 08:38:33 +01:00
parent 0d2dcb3247
commit 1d243c0d03
3 changed files with 18 additions and 16 deletions

View file

@ -87,7 +87,7 @@ class PasswordExportService : Service() {
val targetPasswordFile =
targetDirectory.createFile(
"application/octet-stream",
requireNotNull(name) { "File name cannot be null" }
requireNotNull(name) { "File name cannot be null" },
)
if (targetPasswordFile?.exists() == true) {
val destOutputStream = contentResolver.openOutputStream(targetPasswordFile.uri)
@ -108,13 +108,13 @@ class PasswordExportService : Service() {
sourceDirectory.listFiles().forEach { file ->
if (file.isDirectory) {
// Create new directory and recurse
val newDir =
targetDirectory.createDirectory(
val newDir =
targetDirectory.createDirectory(
requireNotNull(file.name) { "File name cannot be null when creating directory" }
)
copyDirToDir(
file,
requireNotNull(newDir) { "Target directory cannot be null when copying directories" }
file,
requireNotNull(newDir) { "Target directory cannot be null when copying directories" },
)
} else {
copyFileToDir(file, targetDirectory)

View file

@ -8,11 +8,11 @@ import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.content.pm.PackageManager.ResolveInfoFlags
import android.net.Uri
import android.os.Build
import android.provider.Settings
import android.service.autofill.SaveInfo
import androidx.annotation.RequiresApi
import androidx.core.net.toUri
/**
* In order to add a new browser, do the following:
@ -244,7 +244,7 @@ private fun getBrowserAutofillSupportLevel(
public fun getInstalledBrowsersWithAutofillSupportLevel(
context: Context
): List<Pair<String, BrowserAutofillSupportLevel>> {
val testWebIntent = Intent(Intent.ACTION_VIEW).apply { data = Uri.parse("https://example.org") }
val testWebIntent = Intent(Intent.ACTION_VIEW).apply { data = "https://example.org".toUri() }
val installedBrowsers =
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
context.packageManager.queryIntentActivities(

View file

@ -86,9 +86,9 @@ class PGPKeyManagerTest {
// Add key using KeyManager
keyManager.addKey(secretKey).unwrap()
// Remove key
keyManager.removeKey(
requireNotNull(tryGetId(secretKey)) { "Failed to get ID from secret key" }
).unwrap()
keyManager
.removeKey(requireNotNull(tryGetId(secretKey)) { "Failed to get ID from secret key" })
.unwrap()
// Check that no keys remain
val keys = keyManager.getAllKeys().unwrap()
assertEquals(0, keys.size)
@ -209,15 +209,17 @@ class PGPKeyManagerTest {
runTest(dispatcher) {
val alice =
PGPKey(
requireNotNull(this::class.java.classLoader.getResource("alice_owner@example_com")) {
"Resource 'alice_owner@example_com' not found"
}.readBytes()
requireNotNull(this::class.java.classLoader.getResource("alice_owner@example_com")) {
"Resource 'alice_owner@example_com' not found"
}
.readBytes()
)
val bobby =
PGPKey(
requireNotNull(this::class.java.classLoader.getResource("bobby_owner@example_com")) {
"Resource 'bobby_owner@example_com' not found"
}.readBytes()
requireNotNull(this::class.java.classLoader.getResource("bobby_owner@example_com")) {
"Resource 'bobby_owner@example_com' not found"
}
.readBytes()
)
assertTrue(keyManager.addKey(alice).isOk)
assertTrue(keyManager.addKey(bobby).isOk)