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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @JosephSanjaya @kcw-grunt @josikie
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: "gradle"
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 5
149 changes: 149 additions & 0 deletions config/detekt-rule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
console-reports:
active: true
exclude:
- 'ProjectStatisticsReport'
- 'ComplexityReport'
- 'FileBasedFindingsReport'

output-reports:
active: true
exclude:
- 'TxtOutputReport'
- 'XmlOutputReport'

comments:
active: false

complexity:
active: false

coroutines:
active: false

empty-blocks:
active: false

exceptions:
active: false

formatting:
active: true
android: true
ImportOrdering:
active: false
autoCorrect: false
MaximumLineLength:
active: true
maxLineLength: 120
excludes:
- "**/test/**"
- "**/androidTest/**"
- "**/testFixtures/**"
- "**/roboletricTest/**"
Filename:
active: false
PackageName:
active: false

naming:
active: false

performance:
active: false

potential-bugs:
active: false

style:
active: true
UnusedParameter:
active: false
UnusedPrivateProperty:
active: false
ForbiddenImport:
active: false
imports: [ ]
forbiddenPatterns: '(ktor.*|koin.*|kotlinx.datetime.*)'
ForbiddenComment:
active: true
comments:
- reason: 'Forbidden FIXME todo marker in comment, please fix the problem.'
value: 'FIXME:'
- reason: 'Forbidden STOPSHIP todo marker in comment, please address the problem before shipping the code.'
value: 'STOPSHIP:'
allowedPatterns: ''
MaxLineLength:
active: true
maxLineLength: 120
excludeCommentStatements: true
excludes:
- "**/test/**"
- "**/androidTest/**"
- "**/testFixtures/**"
- "**/roboletricTest/**"
UnnecessaryAbstractClass:
active: true
ignoreAnnotated:
- Module
MagicNumber:
active: false
excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**', '**/*.kts' ]
ignoreNumbers:
- '-1'
- '0'
- '1'
- '2'
- '0.2'
- '1024'
UnusedPrivateMember:
active: true
ignoreAnnotated:
- 'Preview'
ReturnCount:
active: false

TwitterCompose:
CompositionLocalAllowlist:
active: false
# You can optionally define a list of CompositionLocals that are allowed here
# allowedCompositionLocals: LocalSomething,LocalSomethingElse
CompositionLocalNaming:
active: true
ContentEmitterReturningValues:
active: true
# You can optionally add your own composables here
# contentEmitters: MyComposable,MyOtherComposable
ModifierComposable:
active: true
ModifierMissing:
active: true
ModifierReused:
active: true
ModifierWithoutDefault:
active: true
MultipleEmitters:
active: true
# You can optionally add your own composables here
# contentEmitters: MyComposable,MyOtherComposable
MutableParams:
active: true
ComposableNaming:
active: true
# You can optionally disable the checks in this rule for regex matches against the composable name (e.g. molecule presenters)
# allowedComposableFunctionNames: .*Presenter,.*MoleculePresenter
ComposableParamOrder:
active: true
PreviewNaming:
active: true
PreviewPublic:
active: true
# You can optionally disable that only previews with @PreviewParameter are flagged
# previewPublicOnlyIfParams: false
RememberMissing:
active: true
UnstableCollections:
active: true
ViewModelForwarding:
active: false
ViewModelInjection:
active: true
76 changes: 76 additions & 0 deletions convention/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
plugins {
`java-gradle-plugin`
`kotlin-dsl`
alias(grunt.plugins.ksp)
alias(grunt.plugins.jacoco)
}

dependencies {
implementation(platform(grunt.koin.bom))
implementation(grunt.bundles.koin.nonandroid)
implementation(grunt.koin.annotation)
ksp(grunt.koin.ksp)
compileOnly(grunt.plugin.agp)
compileOnly(grunt.plugin.kgp)
compileOnly(grunt.plugin.ksp)
compileOnly(grunt.plugin.detekt)
testImplementation(grunt.junit.jupiter)
testImplementation(grunt.junit.jupiter.api)
testImplementation(grunt.mockk)
testRuntimeOnly(grunt.junit.jupiter.engine)
testImplementation(kotlin("test"))
testImplementation(gradleTestKit())
}

extensions.configure<JacocoPluginExtension> {
toolVersion = grunt.versions.jacoco.get()
}

tasks.test {
useJUnitPlatform()
}

tasks.withType<Test>().configureEach {
if (name.startsWith("test") && name.endsWith("UnitTest")) {
extensions.configure(JacocoTaskExtension::class) {
isIncludeNoLocationClasses = true
excludes = listOf("jdk.internal.*")
}
}
}

afterEvaluate {
tasks.withType<JacocoReport> {
group = "verification"
val testTask = tasks.named("test")
dependsOn(testTask)
classDirectories.setFrom(
fileTree(layout.buildDirectory.dir("classes/kotlin/main/com"))
)
val sources = listOf(
layout.projectDirectory.file("src/main/kotlin")
)
sourceDirectories.setFrom(sources)
executionData.setFrom(
layout.buildDirectory.dir("jacoco").get()
.asFileTree.matching { include("**/test.exec") }
)
reports {
xml.required.set(true)
html.required.set(true)
}
}
}

gradlePlugin {
plugins {
register("detekt") {
id = "com.gruntsoftware.buildlogic.detekt"
implementationClass = "com.gruntsoftware.buildlogic.common.plugins.DetektConventionPlugin"
}
register("androidTest") {
id = "com.gruntsoftware.buildlogic.test"
implementationClass = "com.gruntsoftware.buildlogic.android.plugins.TestConventionPlugin"
}
}
}
Loading