danger / kotlin

⚠️ Stop saying "you forgot to …" in code review
MIT License
490 stars 48 forks source link

Inline comments #283

Closed svsorokina closed 2 months ago

svsorokina commented 2 months ago

Hi! Does it support posting inline comments on gitlab?

I use plugin which supports inline comments https://github.com/pavelkorolevxyz/danger-detekt-kotlin. But finally I see only common comment on merge request

Vacxe commented 2 months ago

Hi, could you try to use another one? https://github.com/Vacxe/danger-kotlin-reporters/blob/master/detekt/README.md

@file:Repository("https://s01.oss.sonatype.org/content/groups/staging/")
@file:DependsOn("io.github.vacxe.danger.kotlin:detekt:1.0.0-SNAPSHOT")

import systems.danger.kotlin.*
import systems.danger.kotlin.models.github.*
import io.github.vacxe.danger.kotlin.detekt.DetektPlugin
import java.io.File

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)
    }
}
Vacxe commented 2 months ago

@svsorokina I've created a new plugin. Example can be found here https://github.com/KakaoCup/Kakao/pull/126/files#diff-0886bffc0535f57c376d354f88419f8787896c30f425b6d98777695820159846R1-R23

https://github.com/KakaoCup/Kakao/pull/126#discussion_r1648395005 Comment successfully inlined

Please take a look and let me know if it helps for you. Cheers.

svsorokina commented 2 months ago

@svsorokina I've created a new plugin. Example can be found here https://github.com/KakaoCup/Kakao/pull/126/files#diff-0886bffc0535f57c376d354f88419f8787896c30f425b6d98777695820159846R1-R23

KakaoCup/Kakao#126 (comment) Comment successfully inlined

Please take a look and let me know if it helps for you. Cheers.

Unfortunately this plugin doesn't post inline comments on gitlab either

svsorokina commented 2 months ago

Updating danger-js to version 12.3.3 solved this issue