-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TECH: add detekt to danger inline comments
- Loading branch information
Showing
2 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@file:DependsOn("io.github.vacxe.danger.kotlin:detekt:1.1.0") | ||
|
||
import systems.danger.kotlin.danger | ||
import systems.danger.kotlin.plugin | ||
import io.github.vacxe.danger.kotlin.detekt.DetektPlugin | ||
import java.io.File | ||
|
||
val detektPlugin = DetektPlugin { it.removePrefix("/home/runner/work/Kaspresso/Kaspresso/") } | ||
register.plugin(detektPlugin) | ||
|
||
danger(args) { | ||
detektReport() | ||
} | ||
|
||
fun detektReport() { | ||
val detektReportFile = File("build/reports/detekt/detekt.xml") | ||
if (!detektReportFile.exists()) { | ||
warn( | ||
"Detekt report not exist", | ||
) | ||
} else { | ||
detektPlugin.parseAndReport(detektReportFile) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,12 +16,21 @@ jobs: | |
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Set up JDK | ||
uses: actions/setup-java@v2 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'adopt' | ||
java-version: 17 | ||
cache: gradle | ||
- name: Run static analysis | ||
run: make static_analysis | ||
- name: Detekt to Danger | ||
uses: danger/[email protected] | ||
if: always() | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
dangerfile: ".danger/pr_detekt.df.kts" | ||
args: "--failOnErrors --no-publish-check" | ||
- name: Run unit tests | ||
run: make unit_tests | ||
- name: Build project | ||
|