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

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

dependencies {
Expand All @@ -139,4 +142,5 @@ dependencies {
implementation(libs.gestureviews)
implementation(libs.autofittextview)
implementation(libs.zip4j)
detektPlugins(libs.compose.detekt)
}
8 changes: 0 additions & 8 deletions app/detekt-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
<ID>EmptyFunctionBlock:MimeTypesActivity.kt$MimeTypesActivity${}</ID>
<ID>EmptyFunctionBlock:StorageFragment.kt$StorageFragment${}</ID>
<ID>LargeClass:ItemsAdapter.kt$ItemsAdapter : MyRecyclerViewAdapterOnPopupTextUpdate</ID>
<ID>LongMethod:DecompressActivity.kt$DecompressActivity$private fun fillAllListItems(uri: Uri, callback: () -&gt; Unit)</ID>
<ID>LongMethod:ItemsAdapter.kt$ItemsAdapter$@SuppressLint("NewApi") private fun compressPaths(sourcePaths: List&lt;String&gt;, targetPath: String, password: String? = null): Boolean</ID>
<ID>LongMethod:MimeTypesActivity.kt$MimeTypesActivity$private fun getProperFileDirItems(callback: (ArrayList&lt;FileDirItem&gt;) -&gt; Unit)</ID>
<ID>LongParameterList:ItemsAdapter.kt$ItemsAdapter$( activity: SimpleActivity, var listItems: MutableList&lt;ListItem&gt;, private val listener: ItemOperationsListener?, recyclerView: MyRecyclerView, private val isPickMultipleIntent: Boolean, private val swipeRefreshLayout: SwipeRefreshLayout?, canHaveIndividualViewType: Boolean = true, itemClick: (Any) -&gt; Unit, )</ID>
<ID>LoopWithTooManyJumpStatements:DecompressActivity.kt$DecompressActivity$while</ID>
<ID>LoopWithTooManyJumpStatements:StorageFragment.kt$StorageFragment$do</ID>
<ID>MagicNumber:Config.kt$Config$1.2f</ID>
Expand All @@ -39,15 +35,11 @@
<ID>MagicNumber:ItemsAdapter.kt$ItemsAdapter$180</ID>
<ID>MagicNumber:ItemsAdapter.kt$ItemsAdapter$4</ID>
<ID>MagicNumber:ItemsFragment.kt$ItemsFragment$3</ID>
<ID>MagicNumber:Long.kt$1000.0</ID>
<ID>MagicNumber:MimeTypesActivity.kt$MimeTypesActivity$1000</ID>
<ID>MagicNumber:ReadTextActivity.kt$ReadTextActivity$250</ID>
<ID>MagicNumber:ReadTextActivity.kt$ReadTextActivity$50</ID>
<ID>MagicNumber:RecentsFragment.kt$RecentsFragment$1000</ID>
<ID>MagicNumber:RecentsFragment.kt$RecentsFragment$3</ID>
<ID>MagicNumber:RecentsFragment.kt$RecentsFragment$50</ID>
<ID>MagicNumber:RootHelpers.kt$RootHelpers.&lt;no name provided&gt;$5</ID>
<ID>MagicNumber:StorageFragment.kt$StorageFragment$1000</ID>
<ID>MagicNumber:StorageFragment.kt$StorageFragment$100000</ID>
<ID>MagicNumber:StorageFragment.kt$StorageFragment$2000</ID>
<ID>MagicNumber:StorageFragment.kt$StorageFragment$3</ID>
Expand Down
27 changes: 8 additions & 19 deletions app/lint-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,10 @@
errorLine2=" ~~~~">
<location
file="$HOME/Projects/Fossify/FossifyOrg/File-Manager/gradle/libs.versions.toml"
line="21"
line="22"
column="23"/>
</issue>

<issue
id="UnusedAttribute"
message="Attribute `localeConfig` is only used in API level 33 and higher (current min is 26)"
errorLine1=" android:localeConfig=&quot;@xml/locale_config&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/AndroidManifest.xml"
line="25"
column="9"/>
</issue>

<issue
id="CustomSplashScreen"
message="The application should not provide its own launch screen"
Expand All @@ -68,14 +57,14 @@
</issue>

<issue
id="GradleDependency"
message="A newer version of org.fossify:commons than 3.0.5 is available: 3.1.0"
errorLine1="commons = &quot;3.0.5&quot;"
errorLine2=" ~~~~~~~">
id="AndroidGradlePluginVersion"
message="A newer version of com.android.application than 8.10.1 is available: 8.11.0"
errorLine1="gradlePlugins-agp = &quot;8.10.1&quot;"
errorLine2=" ~~~~~~~~">
<location
file="$HOME/Projects/Fossify/FossifyOrg/File-Manager/gradle/libs.versions.toml"
line="10"
column="11"/>
line="19"
column="21"/>
</issue>

<issue
Expand All @@ -85,7 +74,7 @@
errorLine2=" ~~~~">
<location
file="$HOME/Projects/Fossify/FossifyOrg/File-Manager/gradle/libs.versions.toml"
line="20"
line="21"
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 @@ -3,6 +3,7 @@
kotlin = "2.2.0"
#Detekt
detekt = "1.23.8"
detektCompose = "0.4.22"
#AndroidX
androidx-swiperefreshlayout = "1.1.0"
androidx-documentfile = "1.1.0"
Expand All @@ -26,6 +27,8 @@ app-build-kotlinJVMTarget = "17"
#AndroidX
androidx-swiperefreshlayout = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version.ref = "androidx-swiperefreshlayout" }
androidx-documentfile = { module = "androidx.documentfile:documentfile", version.ref = "androidx-documentfile" }
#Compose
compose-detekt = { module = "io.nlopez.compose.rules:detekt", version.ref = "detektCompose" }
#Fossify
fossify-commons = { module = "org.fossify:commons", version.ref = "commons" }
#Other
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