Permalink
Browse files

Danger base setup

  • Loading branch information...
sergdort committed Jun 3, 2016
1 parent e26bce7 commit e3a87c8801a21a3d1c200bde80ba48a409b6a4e2
Showing with 72 additions and 1 deletion.
  1. +3 −1 .travis.yml
  2. +32 −0 Dangerfile
  3. +3 −0 Gemfile
  4. +34 −0 Gemfile.lock
@@ -6,4 +6,6 @@ notifications:
slack: rxswift:3ykt2Z61f8GkdvhCZTYPduOL
email: false
script: ./scripts/pre-release-tests.sh
script:
- "bundle exec danger --verbose"
- ./scripts/pre-release-tests.sh
@@ -0,0 +1,32 @@
# Sometimes it's a README fix, or something like that - which isn't relevant for
# including in a project's CHANGELOG for example
declared_trivial = pr_title.include? "#trivial"
# Make it more obvious that a PR is a work in progress and shouldn't be merged yet
warn("PR is classed as Work in Progress") if pr_title.include? "[WIP]"
# Warn no CHANGELOG
warn("No CHANGELOG changes made") if lines_of_code > 50 && !modified_files.include?("CHANGELOG.yml") && !declared_trivial
# Warn pod spec changes
warn("RxCocoa.podspec changed") if modified_files.include?("RxCocoa.podspec")
warn("RxSwift.podspec changed") if modified_files.include?("RxSwift.podspec")
warn("RxTests.podspec changed") if modified_files.include?("RxTests.podspec")
warn("RxBlocking.podspec changed") if modified_files.include?("RxBlocking.podspec")
# Warn summary on pull request
if pr_body.length < 5
warn "Please provide a summary in the Pull Request description"
end
# If these are all empty something has gone wrong, better to raise it in a comment
if modified_files.empty? && added_files.empty? && deleted_files.empty?
fail "This PR has no changes at all, this is likely a developer issue."
end
# Warn when there is a big PR
warn("Big PR") if lines_of_code > 500
# Don't let testing shortcuts get into master by accident
fail("fdescribe left in tests") if `grep -r fdescribe specs/`.length > 1
fail("fit left in tests") if `grep -r "fit specs/ `.length > 1
@@ -0,0 +1,3 @@
source 'https://rubygems.org'
gem 'danger'
@@ -0,0 +1,34 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.3.8)
claide (1.0.0)
colored (1.2)
danger (0.7.4)
claide
colored (~> 1.2)
faraday
git
octokit (~> 4.2)
redcarpet (~> 3.3)
terminal-table (~> 1)
faraday (0.9.1)
multipart-post (>= 1.2, < 3)
git (1.3.0)
multipart-post (2.0.0)
octokit (4.3.0)
sawyer (~> 0.7.0, >= 0.5.3)
redcarpet (3.3.4)
sawyer (0.7.0)
addressable (>= 2.3.5, < 2.5)
faraday (~> 0.8, < 0.10)
terminal-table (1.4.5)
PLATFORMS
ruby
DEPENDENCIES
danger
BUNDLED WITH
1.12.5

0 comments on commit e3a87c8

Please sign in to comment.