Skip to content

Commit e4ab762

Browse files
committed
Add accessors for reported messages
1 parent 53dcfb4 commit e4ab762

File tree

1 file changed

+17
-0
lines changed
  • danger-kotlin-library/src/main/kotlin/systems/danger/kotlin

1 file changed

+17
-0
lines changed

danger-kotlin-library/src/main/kotlin/systems/danger/kotlin/MainScript.kt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package systems.danger.kotlin
22

33
import systems.danger.kotlin.models.danger.DangerDSL
44
import systems.danger.kotlin.models.git.FilePath
5+
import systems.danger.kotlin.sdk.Violation
56

67
internal var dangerRunner: MainDangerRunner? = null
78

@@ -133,3 +134,19 @@ fun fail(message: String, file: FilePath, line: Int) =
133134
*/
134135
fun suggest(code: String, file: FilePath, line: Int) =
135136
runnerInstance.suggest(code, file, line)
137+
138+
/** Fails on the Danger report */
139+
val fails: List<Violation>
140+
get() = runnerInstance.fails.toList()
141+
142+
/** Warnings on the Danger report */
143+
val warnings: List<Violation>
144+
get() = runnerInstance.warnings.toList()
145+
146+
/** Messages on the Danger report */
147+
val messages: List<Violation>
148+
get() = runnerInstance.messages.toList()
149+
150+
/** Markdowns on the Danger report */
151+
val markdowns: List<Violation>
152+
get() = runnerInstance.markdowns.toList()

0 commit comments

Comments
 (0)