Skip to content

Commit

Permalink
Merge pull request #10 from Dallinger/danger
Browse files Browse the repository at this point in the history
Check PRs with Danger
  • Loading branch information
DallingerBot committed Sep 6, 2016
2 parents 1dd0bd2 + ac816d8 commit 35412c5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ install:
- wget -O- https://toolbelt.heroku.com/install-ubuntu.sh | sh
- git config --global user.email "dallinger@mailinator.com"
- git config --global user.name "William Henry Dallinger FRS"
- gem install danger
before_script:
- psql -c 'create database db;' -U postgres
env:
Expand All @@ -28,6 +29,7 @@ env:
- secure: fd4hFOH60UV8laBN4Mjva0w/EmVK3SVC5p/0O1oqPriPhUpoJ3eVVRvITbdvPctEJJgRR9t62rPk+Rv4EOXeRFfsjZK9gOfQqv/9VhJBebdQfOx2dwQLjDiGTrklkokDIDyfpyYOoJzZ/oP+6EneD403ilHnXC4fd/4EDQmaIRI=
- secure: 3rnkGugv5Hp71gjwQMUj5tup7/xk94p5IXEh0VItSXTziKn0pBY+yrCzAuIzlylbrl0baLaZOFGEFn2K+Jf+tr9mmN23X+zOUNsIqC4swlLLJx6hzH5AZaRmqzGjURM2gLISUayXGT9flOXyOKzzCGFELJKG9KlVyEOJ4fk04wQ=
script:
- bundle exec danger
- make -C docs html spelling
- nosetests --with-coverage --cover-package dallinger
# - nosetests tests._test_heroku --nocapture
Expand Down
19 changes: 19 additions & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Note contributors not in the organization.
unless github.api.organization_member?('Dallinger', github.pr_author)
message("@#{github.pr_author}, would you like to join the Dallinger org.?")
end

# Encourage writing up some reasoning about the PR.
if github.pr_body.length < 5
fail("Please provide a summary in the Pull Request description.")
end

# Ensure a clean commit history.
if git.commits.any? { |c| c.message =~ /^Merge branch/ }
fail('Please rebase to get rid of the merge commits.')
end

# Require labels on PRs.
has_enhancement_label = github.pr_labels.include?("enhancement")
has_bug_label = github.pr_labels.include?("bug")
warn("Please label as 'enhancement', 'bug', 'demo', or 'release'.", sticky: true) if !has_enhancement_label && !has_bug_label
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source "https://rubygems.org"

gem "danger"

0 comments on commit 35412c5

Please sign in to comment.