From 9e1ab9ad258610ad23ff911031fdac4145761128 Mon Sep 17 00:00:00 2001 From: Brian Yencho Date: Fri, 15 Sep 2023 09:04:49 -0500 Subject: [PATCH] Use 100 character line limit for detekt (#50) --- .../ui/auth/feature/login/LoginScreen.kt | 6 +++- .../platform/components/BitwardenTextField.kt | 4 ++- .../VaultUnlockedNavBarScreen.kt | 35 ++++++++++++++----- detekt-config.yml | 2 +- 4 files changed, 36 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/login/LoginScreen.kt b/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/login/LoginScreen.kt index 6ca062fe4..e25841347 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/login/LoginScreen.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/login/LoginScreen.kt @@ -84,7 +84,11 @@ fun LoginScreen( } // TODO Get the "login target" from a dropdown (BIT-202) Text( - text = stringResource(id = R.string.log_in_attempt_by_x_on_y, state.emailAddress, "bitwarden.com"), + text = stringResource( + id = R.string.log_in_attempt_by_x_on_y, + state.emailAddress, + "bitwarden.com", + ), color = MaterialTheme.colorScheme.primary, style = MaterialTheme.typography.bodySmall, ) diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/BitwardenTextField.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/BitwardenTextField.kt index ba99ddade..e6ea3b22d 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/BitwardenTextField.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/BitwardenTextField.kt @@ -22,7 +22,9 @@ import androidx.compose.ui.unit.dp * * TODO: remove deprecated version: BIT-289 */ -@Deprecated(message = "Use overloaded BitwardenTextField that takes an input instead of an initialText.") +@Deprecated( + message = "Use overloaded BitwardenTextField that takes an input instead of an initialText.", +) @Composable fun BitwardenTextField( label: String, diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/vaultunlockednavbar/VaultUnlockedNavBarScreen.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/vaultunlockednavbar/VaultUnlockedNavBarScreen.kt index b00a4a22e..7f87b7616 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/vaultunlockednavbar/VaultUnlockedNavBarScreen.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/vaultunlockednavbar/VaultUnlockedNavBarScreen.kt @@ -43,19 +43,38 @@ fun VaultUnlockedNavBarScreen( navController.apply { val navOptions = vaultUnlockedNavBarScreenNavOptions() when (event) { - VaultUnlockedNavBarEvent.NavigateToVaultScreen -> navigateToVault(navOptions) - VaultUnlockedNavBarEvent.NavigateToSendScreen -> navigateToSend(navOptions) - VaultUnlockedNavBarEvent.NavigateToGeneratorScreen -> navigateToGenerator(navOptions) - VaultUnlockedNavBarEvent.NavigateToSettingsScreen -> navigateToSettings(navOptions) + VaultUnlockedNavBarEvent.NavigateToVaultScreen -> { + navigateToVault(navOptions) + } + + VaultUnlockedNavBarEvent.NavigateToSendScreen -> { + navigateToSend(navOptions) + } + + VaultUnlockedNavBarEvent.NavigateToGeneratorScreen -> { + navigateToGenerator(navOptions) + } + + VaultUnlockedNavBarEvent.NavigateToSettingsScreen -> { + navigateToSettings(navOptions) + } } } } VaultUnlockedNavBarScaffold( navController = navController, - generatorTabClickedAction = { viewModel.trySendAction(VaultUnlockedNavBarAction.GeneratorTabClick) }, - sendTabClickedAction = { viewModel.trySendAction(VaultUnlockedNavBarAction.SendTabClick) }, - vaultTabClickedAction = { viewModel.trySendAction(VaultUnlockedNavBarAction.VaultTabClick) }, - settingsTabClickedAction = { viewModel.trySendAction(VaultUnlockedNavBarAction.SettingsTabClick) }, + generatorTabClickedAction = { + viewModel.trySendAction(VaultUnlockedNavBarAction.GeneratorTabClick) + }, + sendTabClickedAction = { + viewModel.trySendAction(VaultUnlockedNavBarAction.SendTabClick) + }, + vaultTabClickedAction = { + viewModel.trySendAction(VaultUnlockedNavBarAction.VaultTabClick) + }, + settingsTabClickedAction = { + viewModel.trySendAction(VaultUnlockedNavBarAction.SettingsTabClick) + }, ) } diff --git a/detekt-config.yml b/detekt-config.yml index 838787ea8..2f553bdfd 100644 --- a/detekt-config.yml +++ b/detekt-config.yml @@ -566,7 +566,7 @@ style: active: false MaxLineLength: active: true - maxLineLength: 120 + maxLineLength: 100 excludePackageStatements: true excludeImportStatements: true excludeCommentStatements: false