Skip to content
Permalink
Browse files

Add danger

  • Loading branch information...
msaps committed Dec 2, 2018
1 parent 846f527 commit 5907dafa37d77eb0c9fbfc9780d9aefc21d7d0f3
Showing with 26 additions and 2 deletions.
  1. +3 −0 .travis.yml
  2. +19 −0 Dangerfile
  3. +4 −2 Gemfile
@@ -18,6 +18,9 @@ before_install:
- brew outdated carthage || brew upgrade carthage
- bundle install

before_script:
- bundle exec danger

script:
- .scripts/build

@@ -0,0 +1,19 @@

has_source_changes = !git.modified_files.grep(/Sources.*\.swift/).empty? || !git.added_files.grep(/Sources.*\.swift/).empty?
has_tests_changes = !git.modified_files.grep(/Sources\/TabmanTests.*\.swift/).empty? || !git.added_files.grep(/Sources\/TabmanTests.*\.swift/).empty?

# 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 github.pr_title.include? "[WIP]"

# Warn when there is a big PR
warn("This PR might be a little too big, consider breaking it up.") if git.lines_of_code > 500

# Require PR description
warn "Please provide a summary in the PR description, it makes it easier to understand!" if github.pr_body.length < 5

# Check for source changes and prompt for test updates if non added.
if (has_source_changes && ! has_tests_changes)
warn("Looks like you changed some source files, should there have been some tests added?")
end

swiftlint.lint_files
@@ -1,5 +1,7 @@

source 'https://rubygems.org'

gem "fastlane"
gem "cocoapods"
gem 'fastlane'
gem 'cocoapods'
gem 'danger'
gem 'danger-swiftlint'

0 comments on commit 5907daf

Please sign in to comment.
You can’t perform that action at this time.