Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ android {

detekt {
baseline = file("detekt-baseline.xml")
config.setFrom("$rootDir/detekt.yml")
buildUponDefaultConfig = true
allRules = false
}

dependencies {
Expand All @@ -142,4 +145,5 @@ dependencies {

implementation(libs.bundles.room)
ksp(libs.androidx.room.compiler)
detektPlugins(libs.compose.detekt)
}
9 changes: 0 additions & 9 deletions app/detekt-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
25 changes: 18 additions & 7 deletions app/lint-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand All @@ -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>
Expand All @@ -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>

Expand Down
58 changes: 58 additions & 0 deletions detekt.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 3 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand Down
1 change: 1 addition & 0 deletions lint.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Loading