Skip to content
Switch branches/tags
Go to file
Cannot retrieve contributors at this time
# Don't let testing shortcuts get into master by accident,
# ensuring that we don't get green builds based on a subset of tests
(git.modified_files + git.added_files - %w(Dangerfile)).each do |file|
next unless File.file?(file)
next unless file =~ /^spec.*\.rb/
contents =
fail("`xit` or `fit` left in tests (#{file})") if contents =~ /^\s*[xf]it/
fail("`fdescribe` left in tests (#{file})") if contents =~ /^\s*fdescribe/
# Ensure a clean commits history
if git.commits.any? { |c| c.message =~ /^Merge branch '#{github.branch_for_base}'/ }
fail('Please rebase to get rid of the merge commits in this PR')
# Request a CHANGELOG entry, and give an example
has_app_changes = !git.modified_files.grep(/lib/).empty?
if !git.modified_files.include?('') && has_app_changes
warn("Please include a CHANGELOG entry to credit yourself! \nYou can find it at [](", :sticky => false)
markdown <<-MARKDOWN
Here's an example of your CHANGELOG entry:
* #{github.pr_title}\s\s
*note*: There are two invisible spaces after the entry's text.