Provides the feedback mechanism for Danger. Danger can keep track of
messages, warnings, failure and post arbitrary markdown into a comment.
The message within which Danger communicates back is amended on each run in a session.
fail have a
false by default, which
true means that the message will be crossed out instead of being removed.
If it's not called again on subsequent runs.
markdown support multiple passed arguments
message 'Hello', 'World', file: "Dangerfile", line: 1
warn ['This', 'is', 'warning'], file: "Dangerfile", line: 1
fail 'Ooops', 'bad bad error', sticky: false
markdown '# And', '# Even', '# Markdown', file: "Dangerfile", line: 1
By default, using
fail would fail the corresponding build. Either via an API call, or
via the return value for the danger command. If you have linters with errors for this call
you can use
You can optionally add
line to provide inline feedback on a PR in GitHub, note that
only feedback inside the PR's diff will show up inline. Others will appear inside the main comment.
It is possible to have Danger ignore specific warnings or errors by writing
Danger: Ignore "[warning/error text]".
Sidenote: Messaging is the only plugin which adds functions to the root of the Dangerfile.
Print markdown to below the table
markdown (*markdowns: String, **options: String)
Print out a generate message on the PR
message (*messages: String, **options: Boolean)
Specifies a problem, but not critical
warn (*warnings: String, **options: Boolean)
Declares a CI blocking error
fail (*failures: String, **options: Boolean)
A list of all messages passed to Danger, including
A list of all violations passed to Danger, we don't
anticipate users of Danger needing to use this.
Failing a build
fail "This build didn't pass tests"
fail "Ooops!", "Something bad happend"
fail ["This is example", "with array"]
Failing a build, and note that on subsequent runs
fail("This build didn't pass tests", sticky: true)
Passing a warning
warn "This build didn't pass linting"
warn "Hm...", "This is not really good"
warn ["Multiple warnings", "via array"]
Displaying a markdown table
message = "### Proselint found issues\n\n"
message << "Line | Message | Severity |\n"
message << "| --- | ----- | ----- |\n"
message << "20 | No documentation | Error \n"
markdown "### First issue", "### Second issue"
markdown ["### First issue", "### Second issue"]
Adding an inline warning to a file
warn("You shouldn't use puts in your Dangerfile", file: "Dangerfile", line: 10)