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:
Naveen Singh
2025-07-03 21:16:37 +05:30
committed by GitHub
parent 5e90741c60
commit 49d53e98c9
6 changed files with 84 additions and 16 deletions

View File

@@ -133,6 +133,9 @@ android {
detekt {
baseline = file("detekt-baseline.xml")
config.setFrom("$rootDir/detekt.yml")
buildUponDefaultConfig = true
allRules = false
}
dependencies {
@@ -142,4 +145,5 @@ dependencies {
implementation(libs.bundles.room)
ksp(libs.androidx.room.compiler)
detektPlugins(libs.compose.detekt)
}

View File

@@ -22,18 +22,9 @@
<ID>EmptyFunctionBlock:ClipsActivityAdapter.kt$ClipsActivityAdapter${}</ID>
<ID>ForbiddenComment:SimpleKeyboardIME.kt$SimpleKeyboardIME$// TODO: Change keyboardMode to enum class</ID>
<ID>LargeClass:MyKeyboardView.kt$MyKeyboardView : View</ID>
<ID>LongMethod:Context.kt$fun Context.setupKeyboardDialogStuff( windowToken: IBinder, view: View, dialog: AlertDialog.Builder, titleId: Int = 0, titleText: String = "", cancelOnTouchOutside: Boolean = true, callback: ((alertDialog: AlertDialog) -&gt; Unit)? = null )</ID>
<ID>LongMethod:MyKeyboard.kt$MyKeyboard$@SuppressLint("UseCompatLoadingForDrawables") private fun loadKeyboard(context: Context, parser: XmlResourceParser)</ID>
<ID>LongMethod:MyKeyboardView.kt$MyKeyboardView$@SuppressLint("UseCompatLoadingForDrawables") private fun onBufferDraw()</ID>
<ID>LongMethod:MyKeyboardView.kt$MyKeyboardView$fun setKeyboardHolder(binding: KeyboardViewKeyboardBinding)</ID>
<ID>LongMethod:MyKeyboardView.kt$MyKeyboardView$fun setupKeyboard(changedView: View? = null)</ID>
<ID>LongMethod:MyKeyboardView.kt$MyKeyboardView$override fun onTouchEvent(me: MotionEvent): Boolean</ID>
<ID>LongMethod:MyKeyboardView.kt$MyKeyboardView$private fun onLongPress(popupKey: MyKeyboard.Key, me: MotionEvent): Boolean</ID>
<ID>LongMethod:MyKeyboardView.kt$MyKeyboardView$private fun onModifiedTouchEvent(me: MotionEvent): Boolean</ID>
<ID>LongMethod:MyKeyboardView.kt$MyKeyboardView$private fun setupEmojiAdapter(emojis: List&lt;EmojiData&gt;)</ID>
<ID>LongMethod:MyKeyboardView.kt$MyKeyboardView$private fun showKey(keyIndex: Int)</ID>
<ID>LongMethod:SimpleKeyboardIME.kt$SimpleKeyboardIME$override fun onKey(code: Int)</ID>
<ID>LongParameterList:Context.kt$( windowToken: IBinder, view: View, dialog: AlertDialog.Builder, titleId: Int = 0, titleText: String = "", cancelOnTouchOutside: Boolean = true, callback: ((alertDialog: AlertDialog) -&gt; Unit)? = null )</ID>
<ID>LoopWithTooManyJumpStatements:MyKeyboard.kt$MyKeyboard$while</ID>
<ID>MagicNumber:Config.kt$Config$100</ID>
<ID>MagicNumber:EmojiHelper.kt$3</ID>

View File

@@ -25,8 +25,8 @@
errorLine1="app-build-targetSDK = &quot;34&quot;"
errorLine2=" ~~~~">
<location
file="$HOME/work/Keyboard/Keyboard/gradle/libs.versions.toml"
line="19"
file="$HOME/Projects/Fossify/FossifyOrg/Keyboard/gradle/libs.versions.toml"
line="20"
column="23"/>
</issue>
@@ -47,7 +47,7 @@
errorLine1="distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="$HOME/work/Keyboard/Keyboard/gradle/wrapper/gradle-wrapper.properties"
file="$HOME/Projects/Fossify/FossifyOrg/Keyboard/gradle/wrapper/gradle-wrapper.properties"
line="3"
column="17"/>
</issue>
@@ -58,19 +58,30 @@
errorLine1="gradlePlugins-agp = &quot;8.10.1&quot;"
errorLine2=" ~~~~~~~~">
<location
file="$HOME/work/Keyboard/Keyboard/gradle/libs.versions.toml"
line="16"
file="$HOME/Projects/Fossify/FossifyOrg/Keyboard/gradle/libs.versions.toml"
line="17"
column="21"/>
</issue>
<issue
id="GradleDependency"
message="A newer version of org.jetbrains.kotlin.android than 2.1.21 is available: 2.2.0"
errorLine1="kotlin = &quot;2.1.21&quot;"
errorLine2=" ~~~~~~~~">
<location
file="$HOME/Projects/Fossify/FossifyOrg/Keyboard/gradle/libs.versions.toml"
line="3"
column="10"/>
</issue>
<issue
id="GradleDependency"
message="A newer version of `compileSdkVersion` than 34 is available: 35"
errorLine1="app-build-compileSDKVersion = &quot;34&quot;"
errorLine2=" ~~~~">
<location
file="$HOME/work/Keyboard/Keyboard/gradle/libs.versions.toml"
line="18"
file="$HOME/Projects/Fossify/FossifyOrg/Keyboard/gradle/libs.versions.toml"
line="19"
column="31"/>
</issue>

58
detekt.yml Normal file
View 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

View File

@@ -8,6 +8,7 @@ androidx-emoji2 = "1.5.0"
ksp = "2.1.21-2.0.2"
#Detekt
detekt = "1.23.8"
detektCompose = "0.4.22"
#Room
room = "2.7.2"
#Fossify
@@ -28,6 +29,8 @@ androidx-emoji2-bundled = { module = "androidx.emoji2:emoji2-bundled", version.r
androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "room" }
androidx-room-ktx = { module = "androidx.room:room-ktx", version.ref = "room" }
androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" }
#Compose
compose-detekt = { module = "io.nlopez.compose.rules:detekt", version.ref = "detektCompose" }
#Fossify
fossify-commons = { module = "org.fossify:commons", version.ref = "commons" }
[bundles]

View File

@@ -31,4 +31,5 @@
<issue id="IconDensities" severity="warning" />
<issue id="GradleDependency" severity="warning" />
<issue id="Overdraw" severity="warning" />
<issue id="ExtraTranslation" severity="warning" />
</lint>