Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add danger #18

Merged
merged 14 commits into from
Apr 19, 2017
16 changes: 16 additions & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 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 = github.pr_title.include? "#trivial"
has_source_changes = !git.modified_files.grep(/Source/).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 is a big PR, please consider splitting it up to ease code review.") if git.lines_of_code > 500

# Changelog entries are required for changes to source files.
no_changelog_entry = !git.modified_files.include?("CHANGELOG.md")
if has_source_changes && no_changelog_entry && not_declared_trivial
fail("Any source code changes should have an entry in CHANGELOG.md.")
end
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source 'https://rubygems.org'

gem 'slather'
gem 'danger'
3 changes: 3 additions & 0 deletions run_tests_update_status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ trap trap_handler INT TERM EXIT

updateStatus "pending" "Starting build…"

echo "--- Running Danger"
bundle exec danger --verbose 2>&1|tee `pwd`/log.txt

./build.sh all 2>&1|tee `pwd`/log.txt

rm `pwd`/log.txt
Expand Down