mirror of
https://github.com/FossifyOrg/Flashlight.git
synced 2025-12-23 23:57:45 -05:00
chore: ignore extra translations and update detekt rules
* chore: ignore extra translations in lint Extra translations are removed automatically by Weblate * chore: update detekt rules More compose-friendly * chore: update lint baselines
This commit is contained in:
@@ -138,6 +138,9 @@ android {
|
||||
|
||||
detekt {
|
||||
baseline = file("detekt-baseline.xml")
|
||||
config.setFrom("$rootDir/detekt.yml")
|
||||
buildUponDefaultConfig = true
|
||||
allRules = false
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -146,4 +149,5 @@ dependencies {
|
||||
implementation(libs.bundles.lifecycle)
|
||||
implementation(libs.bundles.compose)
|
||||
debugImplementation(libs.bundles.compose.preview)
|
||||
detektPlugins(libs.compose.detekt)
|
||||
}
|
||||
|
||||
@@ -1,56 +1,21 @@
|
||||
<?xml version="1.0" ?>
|
||||
<SmellBaseline>
|
||||
<ManuallySuppressedIssues></ManuallySuppressedIssues>
|
||||
<ManuallySuppressedIssues/>
|
||||
<CurrentIssues>
|
||||
<ID>FunctionNaming:Activity.kt$@Composable fun CheckFeatureLocked( skipCheck: Boolean )</ID>
|
||||
<ID>FunctionNaming:BrightDisplayActivity.kt$BrightDisplayActivity$@Composable private fun ScreenContent(onChangeColorButtonPress: () -> Unit)</ID>
|
||||
<ID>FunctionNaming:BrightDisplayScreen.kt$@Composable @MyDevices private fun BrightDisplayScreenPreview()</ID>
|
||||
<ID>FunctionNaming:BrightDisplayScreen.kt$@Composable internal fun BrightDisplayScreen( backgroundColor: Int, contrastColor: Int, onChangeColorPress: () -> Unit, sleepTimer: @Composable () -> Unit )</ID>
|
||||
<ID>FunctionNaming:MainActivity.kt$MainActivity$@Composable private fun AppLaunched( donateAlertDialogState: AlertDialogState = getDonateAlertDialogState(), rateStarsAlertDialogState: AlertDialogState = getRateStarsAlertDialogState(), )</ID>
|
||||
<ID>FunctionNaming:MainActivity.kt$MainActivity$@Composable private fun SleepTimerRadioDialog( alertDialogState: AlertDialogState, onCustomValueSelected: () -> Unit )</ID>
|
||||
<ID>FunctionNaming:MainScreen.kt$@Composable @MyDevices internal fun MainScreenPreview()</ID>
|
||||
<ID>FunctionNaming:MainScreen.kt$@Composable internal fun BrightDisplayButton( onBrightDisplayPress: () -> Unit, )</ID>
|
||||
<ID>FunctionNaming:MainScreen.kt$@Composable internal fun FlashlightButton( flashlightActive: Boolean, onFlashlightPress: () -> Unit, )</ID>
|
||||
<ID>FunctionNaming:MainScreen.kt$@Composable internal fun MainScreen( flashlightButton: @Composable () -> Unit, brightDisplayButton: @Composable () -> Unit, sosButton: @Composable () -> Unit, stroboscopeButton: @Composable () -> Unit, slidersSection: @Composable () -> Unit, sleepTimer: @Composable () -> Unit, showMoreApps: Boolean, openSettings: () -> Unit, openAbout: () -> Unit, openSleepTimer: () -> Unit, moreAppsFromUs: () -> Unit, )</ID>
|
||||
<ID>FunctionNaming:MainScreen.kt$@Composable internal fun MainScreenSlidersSection( showBrightnessBar: Boolean, brightnessBarValue: Float, onBrightnessBarValueChange: (Float) -> Unit, showStroboscopeBar: Boolean, stroboscopeBarValue: Float, onStroboscopeBarValueChange: (Float) -> Unit, )</ID>
|
||||
<ID>FunctionNaming:MainScreen.kt$@Composable internal fun SosButton( sosActive: Boolean, onSosButtonPress: () -> Unit, )</ID>
|
||||
<ID>FunctionNaming:MainScreen.kt$@Composable internal fun StroboscopeButton( stroboscopeActive: Boolean, onStroboscopeButtonPress: () -> Unit, )</ID>
|
||||
<ID>FunctionNaming:MainScreen.kt$@Composable private fun SmallButton( painter: Painter, contentDescription: String, isActive: Boolean, onPress: () -> Unit )</ID>
|
||||
<ID>FunctionNaming:SettingsScreen.kt$@Composable @MyDevices private fun SettingsScreenPreview()</ID>
|
||||
<ID>FunctionNaming:SettingsScreen.kt$@Composable internal fun ColorCustomizationSettingsSection( customizeColors: () -> Unit, customizeWidgetColors: () -> Unit, )</ID>
|
||||
<ID>FunctionNaming:SettingsScreen.kt$@Composable internal fun GeneralSettingsSection( showUseEnglish: Boolean, useEnglishChecked: Boolean, showDisplayLanguage: Boolean, displayLanguage: String, turnFlashlightOnStartupChecked: Boolean, forcePortraitModeChecked: Boolean, showBrightDisplayButtonChecked: Boolean, showSosButtonChecked: Boolean, showStroboscopeButtonChecked: Boolean, onUseEnglishPress: (Boolean) -> Unit, onSetupLanguagePress: () -> Unit, onTurnFlashlightOnStartupPress: (Boolean) -> Unit, onForcePortraitModePress: (Boolean) -> Unit, onShowBrightDisplayButtonPress: (Boolean) -> Unit, onShowSosButtonPress: (Boolean) -> Unit, onShowStroboscopeButtonPress: (Boolean) -> Unit, )</ID>
|
||||
<ID>FunctionNaming:SettingsScreen.kt$@Composable internal fun SettingsScreen( colorCustomizationSection: @Composable () -> Unit, generalSection: @Composable () -> Unit, goBack: () -> Unit, )</ID>
|
||||
<ID>FunctionNaming:SleepTimer.kt$@Composable @MyDevices internal fun SleepTimerPreview()</ID>
|
||||
<ID>FunctionNaming:SleepTimer.kt$@Composable internal fun AnimatedSleepTimer( modifier: Modifier = Modifier, timerText: String, timerVisible: Boolean, onTimerClosePress: () -> Unit )</ID>
|
||||
<ID>FunctionNaming:SleepTimer.kt$@Composable internal fun SleepTimer( modifier: Modifier = Modifier, timerText: String, onCloseClick: () -> Unit )</ID>
|
||||
<ID>FunctionNaming:SleepTimerCustomAlertDialog.kt$@Composable @MyDevices private fun SleepTimerCustomAlertDialogPreview()</ID>
|
||||
<ID>FunctionNaming:SleepTimerCustomAlertDialog.kt$@Composable fun SleepTimerCustomAlertDialog( alertDialogState: AlertDialogState, modifier: Modifier = Modifier, onConfirmClick: (seconds: Int) -> Unit, onCancelClick: (() -> Unit)? = null )</ID>
|
||||
<ID>FunctionNaming:WidgetConfigureScreen.kt$@Composable @MyDevices private fun WidgetBrightDisplayConfigureScreenPreview()</ID>
|
||||
<ID>FunctionNaming:WidgetConfigureScreen.kt$@Composable internal fun WidgetConfigureScreen( @DrawableRes widgetDrawable: Int, @ColorInt widgetColor: Int, widgetAlpha: Float, onSliderChanged: (Float) -> Unit, onColorPressed: () -> Unit, onSavePressed: () -> Unit )</ID>
|
||||
<ID>LongMethod:MainActivity.kt$MainActivity$override fun onCreate(savedInstanceState: Bundle?)</ID>
|
||||
<ID>LongMethod:SettingsActivity.kt$SettingsActivity$override fun onCreate(savedInstanceState: Bundle?)</ID>
|
||||
<ID>LongMethod:SleepTimerCustomAlertDialog.kt$@Composable fun SleepTimerCustomAlertDialog( alertDialogState: AlertDialogState, modifier: Modifier = Modifier, onConfirmClick: (seconds: Int) -> Unit, onCancelClick: (() -> Unit)? = null )</ID>
|
||||
<ID>LongParameterList:Activity.kt$( appNameId: Int, licenseMask: Long, versionName: String, faqItems: ArrayList<FAQItem>, showFAQBeforeMail: Boolean, getAppIconIDs: ArrayList<Int> = getAppIconIDs(), getAppLauncherName: String = launcherName() )</ID>
|
||||
<ID>LongParameterList:MainScreen.kt$( flashlightButton: @Composable () -> Unit, brightDisplayButton: @Composable () -> Unit, sosButton: @Composable () -> Unit, stroboscopeButton: @Composable () -> Unit, slidersSection: @Composable () -> Unit, sleepTimer: @Composable () -> Unit, showMoreApps: Boolean, openSettings: () -> Unit, openAbout: () -> Unit, openSleepTimer: () -> Unit, moreAppsFromUs: () -> Unit, )</ID>
|
||||
<ID>LongParameterList:MainScreen.kt$( showBrightnessBar: Boolean, brightnessBarValue: Float, onBrightnessBarValueChange: (Float) -> Unit, showStroboscopeBar: Boolean, stroboscopeBarValue: Float, onStroboscopeBarValueChange: (Float) -> Unit, )</ID>
|
||||
<ID>LongParameterList:SettingsScreen.kt$( showUseEnglish: Boolean, useEnglishChecked: Boolean, showDisplayLanguage: Boolean, displayLanguage: String, turnFlashlightOnStartupChecked: Boolean, forcePortraitModeChecked: Boolean, showBrightDisplayButtonChecked: Boolean, showSosButtonChecked: Boolean, showStroboscopeButtonChecked: Boolean, onUseEnglishPress: (Boolean) -> Unit, onSetupLanguagePress: () -> Unit, onTurnFlashlightOnStartupPress: (Boolean) -> Unit, onForcePortraitModePress: (Boolean) -> Unit, onShowBrightDisplayButtonPress: (Boolean) -> Unit, onShowSosButtonPress: (Boolean) -> Unit, onShowStroboscopeButtonPress: (Boolean) -> Unit, )</ID>
|
||||
<ID>LongParameterList:WidgetConfigureScreen.kt$( @DrawableRes widgetDrawable: Int, @ColorInt widgetColor: Int, widgetAlpha: Float, onSliderChanged: (Float) -> Unit, onColorPressed: () -> Unit, onSavePressed: () -> Unit )</ID>
|
||||
<ID>MagicNumber:Config.kt$Config$1000</ID>
|
||||
<ID>MagicNumber:Config.kt$Config$1000L</ID>
|
||||
<ID>ComposableParamOrder:SleepTimer.kt$AnimatedSleepTimer</ID>
|
||||
<ID>ComposableParamOrder:SleepTimer.kt$SleepTimer</ID>
|
||||
<ID>ComposableParamOrder:SleepTimerCustomAlertDialog.kt$SleepTimerCustomAlertDialog</ID>
|
||||
<ID>LambdaParameterEventTrailing:SleepTimer.kt$onCloseClick</ID>
|
||||
<ID>LambdaParameterEventTrailing:SleepTimer.kt$onTimerClosePress</ID>
|
||||
<ID>MagicNumber:Config.kt$Config$30</ID>
|
||||
<ID>MagicNumber:Config.kt$Config$60</ID>
|
||||
<ID>MagicNumber:Context.kt$60</ID>
|
||||
<ID>MagicNumber:MainActivity.kt$MainActivity$10</ID>
|
||||
<ID>MagicNumber:MainActivity.kt$MainActivity$1000</ID>
|
||||
<ID>MagicNumber:MainActivity.kt$MainActivity$30</ID>
|
||||
<ID>MagicNumber:MainActivity.kt$MainActivity$3600</ID>
|
||||
<ID>MagicNumber:MainActivity.kt$MainActivity$5</ID>
|
||||
<ID>MagicNumber:MainActivity.kt$MainActivity$60</ID>
|
||||
<ID>MagicNumber:MainActivity.kt$MainActivity.MainViewModel$0.5f</ID>
|
||||
<ID>MagicNumber:MyCameraImpl.kt$MyCameraImpl$1000L</ID>
|
||||
<ID>MagicNumber:SleepTimer.kt$SleepTimer$1000L</ID>
|
||||
<ID>MagicNumber:SleepTimer.kt$SleepTimer.<no name provided>$1000</ID>
|
||||
<ID>MagicNumber:SleepTimerCustomAlertDialog.kt$60</ID>
|
||||
<ID>MagicNumber:WidgetConfigureViewModel.kt$WidgetConfigureViewModel$255f</ID>
|
||||
<ID>MaxLineLength:BrightDisplayActivity.kt$BrightDisplayActivity$AnimatedSleepTimer(timerText = timerText, timerVisible = timerVisible, onTimerClosePress = ::stopSleepTimer)</ID>
|
||||
<ID>MaxLineLength:BrightDisplayActivity.kt$BrightDisplayActivity$requestedOrientation = if (config.forcePortraitMode) ActivityInfo.SCREEN_ORIENTATION_PORTRAIT else ActivityInfo.SCREEN_ORIENTATION_SENSOR</ID>
|
||||
@@ -96,6 +61,11 @@
|
||||
<ID>MaxLineLength:WidgetConfigureViewModel.kt$WidgetConfigureViewModel$if</ID>
|
||||
<ID>MaxLineLength:WidgetTorchConfigureActivity.kt$WidgetTorchConfigureActivity$viewModel.setWidgetId(intent.extras?.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID) ?: AppWidgetManager.INVALID_APPWIDGET_ID)</ID>
|
||||
<ID>MemberNameEqualsClassName:SleepTimer.kt$SleepTimer$private var sleepTimer: CountDownTimer? = null</ID>
|
||||
<ID>MultipleEmitters:MainScreen.kt$MainScreenSlidersSection</ID>
|
||||
<ID>ParameterNaming:MainActivity.kt$MainActivity$onCustomValueSelected</ID>
|
||||
<ID>ParameterNaming:WidgetConfigureScreen.kt$onColorPressed</ID>
|
||||
<ID>ParameterNaming:WidgetConfigureScreen.kt$onSavePressed</ID>
|
||||
<ID>ParameterNaming:WidgetConfigureScreen.kt$onSliderChanged</ID>
|
||||
<ID>ReturnCount:MyCameraImpl.kt$MyCameraImpl$fun toggleSOS(): Boolean</ID>
|
||||
<ID>ReturnCount:MyCameraImpl.kt$MyCameraImpl$fun toggleStroboscope(): Boolean</ID>
|
||||
<ID>SwallowedException:Activity.kt$e: Exception</ID>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
errorLine2=" ~~~~">
|
||||
<location
|
||||
file="$HOME/Projects/Fossify/FossifyOrg/Flashlight/gradle/libs.versions.toml"
|
||||
line="20"
|
||||
line="21"
|
||||
column="23"/>
|
||||
</issue>
|
||||
|
||||
@@ -85,6 +85,17 @@
|
||||
column="17"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="AndroidGradlePluginVersion"
|
||||
message="A newer version of com.android.application than 8.10.1 is available: 8.11.0"
|
||||
errorLine1="gradlePlugins-agp = "8.10.1""
|
||||
errorLine2=" ~~~~~~~~">
|
||||
<location
|
||||
file="$HOME/Projects/Fossify/FossifyOrg/Flashlight/gradle/libs.versions.toml"
|
||||
line="18"
|
||||
column="21"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="GradleDependency"
|
||||
message="A newer version of androidx.lifecycle:lifecycle-runtime-compose than 2.9.0 is available: 2.9.1"
|
||||
@@ -92,7 +103,7 @@
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="$HOME/Projects/Fossify/FossifyOrg/Flashlight/gradle/libs.versions.toml"
|
||||
line="9"
|
||||
line="10"
|
||||
column="22"/>
|
||||
</issue>
|
||||
|
||||
@@ -103,7 +114,7 @@
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="$HOME/Projects/Fossify/FossifyOrg/Flashlight/gradle/libs.versions.toml"
|
||||
line="9"
|
||||
line="10"
|
||||
column="22"/>
|
||||
</issue>
|
||||
|
||||
@@ -114,7 +125,7 @@
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="$HOME/Projects/Fossify/FossifyOrg/Flashlight/gradle/libs.versions.toml"
|
||||
line="9"
|
||||
line="10"
|
||||
column="22"/>
|
||||
</issue>
|
||||
|
||||
@@ -125,7 +136,7 @@
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="$HOME/Projects/Fossify/FossifyOrg/Flashlight/gradle/libs.versions.toml"
|
||||
line="9"
|
||||
line="10"
|
||||
column="22"/>
|
||||
</issue>
|
||||
|
||||
@@ -136,7 +147,7 @@
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="$HOME/Projects/Fossify/FossifyOrg/Flashlight/gradle/libs.versions.toml"
|
||||
line="14"
|
||||
line="15"
|
||||
column="11"/>
|
||||
</issue>
|
||||
|
||||
@@ -147,7 +158,7 @@
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="$HOME/Projects/Fossify/FossifyOrg/Flashlight/gradle/libs.versions.toml"
|
||||
line="14"
|
||||
line="15"
|
||||
column="11"/>
|
||||
</issue>
|
||||
|
||||
@@ -158,7 +169,7 @@
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="$HOME/Projects/Fossify/FossifyOrg/Flashlight/gradle/libs.versions.toml"
|
||||
line="14"
|
||||
line="15"
|
||||
column="11"/>
|
||||
</issue>
|
||||
|
||||
@@ -169,7 +180,7 @@
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="$HOME/Projects/Fossify/FossifyOrg/Flashlight/gradle/libs.versions.toml"
|
||||
line="14"
|
||||
line="15"
|
||||
column="11"/>
|
||||
</issue>
|
||||
|
||||
@@ -180,7 +191,7 @@
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="$HOME/Projects/Fossify/FossifyOrg/Flashlight/gradle/libs.versions.toml"
|
||||
line="14"
|
||||
line="15"
|
||||
column="11"/>
|
||||
</issue>
|
||||
|
||||
@@ -191,7 +202,7 @@
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="$HOME/Projects/Fossify/FossifyOrg/Flashlight/gradle/libs.versions.toml"
|
||||
line="14"
|
||||
line="15"
|
||||
column="11"/>
|
||||
</issue>
|
||||
|
||||
@@ -202,18 +213,18 @@
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="$HOME/Projects/Fossify/FossifyOrg/Flashlight/gradle/libs.versions.toml"
|
||||
line="14"
|
||||
line="15"
|
||||
column="11"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="GradleDependency"
|
||||
message="A newer version of androidx.compose.material3:material3 than 1.4.0-alpha15 is available: 1.4.0-alpha16"
|
||||
message="A newer version of androidx.compose.material3:material3 than 1.4.0-alpha15 is available: 1.4.0-alpha17"
|
||||
errorLine1="composeMaterial3 = "1.4.0-alpha15""
|
||||
errorLine2=" ~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="$HOME/Projects/Fossify/FossifyOrg/Flashlight/gradle/libs.versions.toml"
|
||||
line="15"
|
||||
line="16"
|
||||
column="20"/>
|
||||
</issue>
|
||||
|
||||
|
||||
58
detekt.yml
Normal file
58
detekt.yml
Normal file
@@ -0,0 +1,58 @@
|
||||
build:
|
||||
maxIssues: 0
|
||||
weights:
|
||||
complexity: 2
|
||||
LongParameterList: 2
|
||||
style: 1
|
||||
|
||||
processors:
|
||||
active: true
|
||||
exclude:
|
||||
- "FunctionCountProcessor"
|
||||
- "PropertyCountProcessor"
|
||||
|
||||
config:
|
||||
validation: true
|
||||
|
||||
complexity:
|
||||
LongParameterList:
|
||||
active: true
|
||||
functionThreshold: 10
|
||||
constructorThreshold: 8
|
||||
ignoreDefaultParameters: true
|
||||
ignoreAnnotated:
|
||||
- "Composable"
|
||||
LongMethod:
|
||||
active: true
|
||||
threshold: 120
|
||||
ignoreAnnotated:
|
||||
- "Composable"
|
||||
- "Preview"
|
||||
|
||||
style:
|
||||
MagicNumber:
|
||||
active: true
|
||||
ignoreAnnotated: ["Composable"]
|
||||
ignoreEnums: true
|
||||
ignoreNumbers: ["-1", "0", "1", "2", "42", "1000"]
|
||||
MaxLineLength:
|
||||
active: true
|
||||
maxLineLength: 120
|
||||
excludePackageStatements: true
|
||||
excludeImportStatements: true
|
||||
|
||||
naming:
|
||||
FunctionNaming:
|
||||
active: true
|
||||
ignoreAnnotated: ["Composable", "Preview"]
|
||||
functionPattern: "[a-z][A-Za-z0-9]*"
|
||||
|
||||
Compose: # io.nlopez.compose.rules
|
||||
ComposableParametersOrdering:
|
||||
active: true
|
||||
ModifierDefaultValue:
|
||||
active: true
|
||||
MissingModifierDefaultValue:
|
||||
active: true
|
||||
PublicComposablePreview:
|
||||
active: true
|
||||
@@ -3,6 +3,7 @@
|
||||
kotlin = "2.2.0"
|
||||
#Detekt
|
||||
detekt = "1.23.8"
|
||||
detektCompose = "0.4.22"
|
||||
#AndroidX
|
||||
androidx-customView = "1.2.0"
|
||||
androidx-customViewPooling = "1.1.0"
|
||||
@@ -43,6 +44,7 @@ compose-ui = { module = "androidx.compose.ui:ui", version.ref = "compose" }
|
||||
compose-runtime = { module = "androidx.compose.runtime:runtime", version.ref = "compose" }
|
||||
compose-uiTooling-debug = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" }
|
||||
compose-uiTooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose" }
|
||||
compose-detekt = { module = "io.nlopez.compose.rules:detekt", version.ref = "detektCompose" }
|
||||
[bundles]
|
||||
compose = [
|
||||
"compose-activity",
|
||||
|
||||
Reference in New Issue
Block a user