Skip to content

Commit

Permalink
Merge pull request #9 from alongotv/feature/detekt
Browse files Browse the repository at this point in the history
Add detekt support to project
  • Loading branch information
alongotv authored May 1, 2024
2 parents 79bf5cb + ae40567 commit 1a9fda2
Show file tree
Hide file tree
Showing 3 changed files with 822 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Stroggs Bot Code Validation and Testing
on:
pull_request:
branches: [ trunk ]
types: [ opened, synchronize ]

jobs:
detekt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout repository
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: gradle/gradle-build-action@v2
name: Setup Gradle
- name: Run detekt with Gradle wrapper
run: ./gradlew detekt
20 changes: 19 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ repositories {
maven("https://jitpack.io")
}


val detekt: Configuration by configurations.creating

val detektTask = tasks.register<JavaExec>("detekt") {
mainClass.set("io.gitlab.arturbosch.detekt.cli.Main")
classpath = detekt

val input = projectDir
val config = "$projectDir/detekt.yml"
val exclude = ".*/build/.*,.*/resources/.*"
val params = listOf("-i", input, "-c", config, "-ex", exclude)

args(params)
}

dependencies {
val kordVersion = "0.11.1"
val zxingVersion = "3.5.3"
Expand All @@ -36,10 +51,13 @@ dependencies {
implementation("dev.arbjerg:lavaplayer:$lavaPlayerVersion")
implementation("org.slf4j:slf4j-simple:1.7.36")

implementation ("com.google.dagger:dagger:$daggerVersion")
implementation("com.google.dagger:dagger:$daggerVersion")
ksp("com.google.dagger:dagger-compiler:$daggerVersion")

detekt("io.gitlab.arturbosch.detekt:detekt-cli:1.23.3")
}


tasks.test {
useJUnitPlatform()
}
Expand Down
Loading

0 comments on commit 1a9fda2

Please sign in to comment.