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 @@ -129,6 +129,9 @@ android {

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

dependencies {
Expand All @@ -140,4 +143,5 @@ dependencies {
implementation(libs.androidx.constraintlayout)
implementation(libs.tandroidlame)
implementation(libs.autofittextview)
detektPlugins(libs.compose.detekt)
}
7 changes: 0 additions & 7 deletions app/detekt-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,11 @@
<ID>EmptyFunctionBlock:TrashAdapter.kt$TrashAdapter${}</ID>
<ID>EmptyFunctionBlock:TrashFragment.kt$TrashFragment${}</ID>
<ID>EmptyFunctionBlock:WidgetRecordDisplayConfigureActivity.kt$WidgetRecordDisplayConfigureActivity.&lt;no name provided&gt;${}</ID>
<ID>MagicNumber:Activity.kt$1000</ID>
<ID>MagicNumber:Activity.kt$1000L</ID>
<ID>MagicNumber:Context.kt$60</ID>
<ID>MagicNumber:Mp3Recorder.kt$Mp3Recorder$1.25</ID>
<ID>MagicNumber:Mp3Recorder.kt$Mp3Recorder$1000</ID>
<ID>MagicNumber:Mp3Recorder.kt$Mp3Recorder$7200</ID>
<ID>MagicNumber:Mp3Recorder.kt$Mp3Recorder$8</ID>
<ID>MagicNumber:PlayerFragment.kt$PlayerFragment$1000</ID>
<ID>MagicNumber:PlayerFragment.kt$PlayerFragment.&lt;no name provided&gt;$1000</ID>
<ID>MagicNumber:RecorderFragment.kt$RecorderFragment$500</ID>
<ID>MagicNumber:RecorderService.kt$RecorderService$1000</ID>
<ID>MagicNumber:SettingsActivity.kt$SettingsActivity$1000</ID>
<ID>MagicNumber:ViewPagerAdapter.kt$ViewPagerAdapter$3</ID>
<ID>MagicNumber:WidgetRecordDisplayConfigureActivity.kt$WidgetRecordDisplayConfigureActivity$100</ID>
<ID>MaxLineLength:PlayerFragment.kt$PlayerFragment$if</ID>
Expand Down
33 changes: 22 additions & 11 deletions app/lint-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
errorLine1="app-build-targetSDK = &quot;34&quot;"
errorLine2=" ~~~~">
<location
file="$HOME/work/Voice-Recorder/Voice-Recorder/gradle/libs.versions.toml"
line="27"
file="$HOME/Projects/Fossify/FossifyOrg/Voice-Recorder/gradle/libs.versions.toml"
line="28"
column="23"/>
</issue>

Expand All @@ -29,7 +29,7 @@
errorLine1="distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="$HOME/work/Voice-Recorder/Voice-Recorder/gradle/wrapper/gradle-wrapper.properties"
file="$HOME/Projects/Fossify/FossifyOrg/Voice-Recorder/gradle/wrapper/gradle-wrapper.properties"
line="3"
column="17"/>
</issue>
Expand All @@ -40,34 +40,45 @@
errorLine1="gradlePlugins-agp = &quot;8.10.1&quot;"
errorLine2=" ~~~~~~~~">
<location
file="$HOME/work/Voice-Recorder/Voice-Recorder/gradle/libs.versions.toml"
line="24"
file="$HOME/Projects/Fossify/FossifyOrg/Voice-Recorder/gradle/libs.versions.toml"
line="25"
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/Voice-Recorder/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/Voice-Recorder/Voice-Recorder/gradle/libs.versions.toml"
line="26"
file="$HOME/Projects/Fossify/FossifyOrg/Voice-Recorder/gradle/libs.versions.toml"
line="27"
column="31"/>
</issue>

<issue
id="Aligned16KB"
message="The native library `x86_64/libandroidlame.so` (from `com.github.naman14:TAndroidLame:1.1`) is not 16 KB aligned">
<location
file="$GRADLE_USER_HOME/caches/8.11.1/transforms/94a3a2f7bc4ddf8ffe0a8dbe891c7f45/transformed/jetified-TAndroidLame-1.1/jni/x86_64/libandroidlame.so"/>
file="$GRADLE_USER_HOME/caches/8.11.1/transforms/865938d5cceb8e098c463c7b38a51bdf/transformed/jetified-TAndroidLame-1.1/jni/x86_64/libandroidlame.so"/>
</issue>

<issue
id="Aligned16KB"
message="The native library `x86_64/libandroidlame.so` (from `com.github.naman14:TAndroidLame:1.1`) is not 16 KB aligned">
<location
file="$GRADLE_USER_HOME/caches/8.11.1/transforms/94a3a2f7bc4ddf8ffe0a8dbe891c7f45/transformed/jetified-TAndroidLame-1.1/jni/x86_64/libandroidlame.so"/>
file="$GRADLE_USER_HOME/caches/8.11.1/transforms/865938d5cceb8e098c463c7b38a51bdf/transformed/jetified-TAndroidLame-1.1/jni/x86_64/libandroidlame.so"/>
</issue>

<issue
Expand All @@ -76,8 +87,8 @@
errorLine1="tandroidlame = { module = &quot;com.github.naman14:TAndroidLame&quot;, version.ref = &quot;tandroidlame&quot; }"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="$HOME/work/Voice-Recorder/Voice-Recorder/gradle/libs.versions.toml"
line="43"
file="$HOME/Projects/Fossify/FossifyOrg/Voice-Recorder/gradle/libs.versions.toml"
line="46"
column="17"/>
</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 @@ -5,6 +5,7 @@ kotlin = "2.1.21"
ksp = "2.1.21-2.0.2"
#Detekt
detekt = "1.23.8"
detektCompose = "0.4.22"
#AndroidX
androidx-constraintlayout = "2.2.1"
androidx-documentfile = "1.1.0"
Expand Down Expand Up @@ -33,6 +34,8 @@ app-build-kotlinJVMTarget = "17"
androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "androidx-constraintlayout" }
androidx-documentfile = { module = "androidx.documentfile:documentfile", version.ref = "androidx-documentfile" }
androidx-swiperefreshlayout = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version.ref = "androidx-swiperefreshlayout" }
#Compose
compose-detekt = { module = "io.nlopez.compose.rules:detekt", version.ref = "detektCompose" }
#Fossify
fossify-commons = { module = "org.fossify:commons", version.ref = "commons" }
#EventBus
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