From 7b5ebd239e35f7b35523b6b23eca6ca2a72f131c Mon Sep 17 00:00:00 2001 From: Wojtek Zieba Date: Fri, 17 Jan 2025 17:32:08 +0100 Subject: [PATCH] Disable `formatting` rules from fluxc and login modules They were not enabled/configured back in FluxC, so enabling them here causes hundreds of violations. Adjust `MagicNumber` rule to also fit newly added codebase --- config/detekt/detekt.yml | 3 +++ .../org/wordpress/android/login/SignupConfirmationFragment.kt | 1 + 2 files changed, 4 insertions(+) diff --git a/config/detekt/detekt.yml b/config/detekt/detekt.yml index 9c4f3d1d3f1..e3a5e4c73ed 100644 --- a/config/detekt/detekt.yml +++ b/config/detekt/detekt.yml @@ -15,6 +15,7 @@ complexity: formatting: active: true autoCorrect: true + excludes: ['**/fluxc/**', '**/login/**'] Indentation: active: true autoCorrect: true @@ -27,6 +28,8 @@ style: active: true ignoreAnnotated: [ 'Module' ] MagicNumber: + ignoreEnums: true + ignorePropertyDeclaration: true ignoreAnnotated: [ 'Composable' ] UnusedPrivateMember: ignoreAnnotated: [ 'Preview', 'LightDarkThemePreviews', 'OrientationPreviews', 'FontScalePreviews', 'LayoutDirectionPreviews' ] diff --git a/libs/login/src/main/java/org/wordpress/android/login/SignupConfirmationFragment.kt b/libs/login/src/main/java/org/wordpress/android/login/SignupConfirmationFragment.kt index 6d07973b1c4..43e72c77875 100644 --- a/libs/login/src/main/java/org/wordpress/android/login/SignupConfirmationFragment.kt +++ b/libs/login/src/main/java/org/wordpress/android/login/SignupConfirmationFragment.kt @@ -64,6 +64,7 @@ class SignupConfirmationFragment : Fragment(), MenuProvider { AndroidSupportInjection.inject(this) super.onAttach(context) if (context !is LoginListener) { + @Suppress("TooGenericExceptionThrown") throw RuntimeException("$context must implement LoginListener") } mLoginListener = context