Skip to content

Commit

Permalink
Danger base setup
Browse files Browse the repository at this point in the history
  • Loading branch information
sergdort committed Jun 3, 2016
1 parent e26bce7 commit e3a87c8
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .travis.yml
Expand Up @@ -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
32 changes: 32 additions & 0 deletions Dangerfile
@@ -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
3 changes: 3 additions & 0 deletions Gemfile
@@ -0,0 +1,3 @@
source 'https://rubygems.org'

gem 'danger'
34 changes: 34 additions & 0 deletions Gemfile.lock
@@ -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.