Slide 27
Slide 27 text
Danger 4/4
# Oddly enough, it's quite possible to do some testing of Danger, inside Danger
# So, you can ignore these, if you're looking at the Dangerfile to get ideas.
#
# If these are all empty something has gone wrong, better to raise it in a comment
if git.modified_files.empty? && git.added_files.empty? && git.deleted_files.empty?
fail "This PR has no changes at all, this is likely an issue during development."
end
# This comes from `./danger_plugins/protect_files.rb` which is automatically parsed by Danger
files.protect_files(path: "danger.gemspec", message: ".gemspec modified", fail_build: false)
# Ensure that our core plugins all have 100% documentation
core_plugins = Dir.glob("lib/danger/danger_core/plugins/*.rb")
core_lint_output = `bundle exec yard stats #{core_plugins.join " "} --list-undoc --tag tags`
if !core_lint_output.include?("100.00%")
fail "The core plugins are not at 100% doc'd - see below:", sticky: false
elsif core_lint_output.include? "warning"
warn "The core plugins are have yard warnings - see below", sticky: false
markdown "```\n#{core_lint_output}```"
end
junit.parse "junit-results.xml"
junit.headers = %i(file name)
junit.report