awesome-ios/Dangerfile

23 lines
891 B
Plaintext
Raw Permalink Normal View History

2016-07-26 05:59:35 +08:00
# Ensure there is a summary for a pull request
2016-07-28 03:36:40 +08:00
fail 'Please provide a summary in the Pull Request description' if github.pr_body.length < 5
2016-07-26 05:59:35 +08:00
# Warn when there are merge commits in the diff
2016-07-28 03:36:40 +08:00
warn 'Please rebase to get rid of the merge commits in this Pull Request' if git.commits.any? { |c| c.message =~ /^Merge branch 'master'/ }
2016-07-26 05:59:35 +08:00
# Only one library per pull request
warn 'Too many changes (when adding, please keep it to one project per Pull Request)' if git.insertions > 1
2016-07-28 03:36:40 +08:00
# Warn if pull request is not updated
warn 'Please update the Pull Request title to contain the library name' if github.pr_title.include? 'Update README.md'
# Check links
require 'json'
2016-08-04 02:01:47 +08:00
results = File.read 'ab-results-README.md-markdown-table.json'
j = JSON.parse results
2016-08-04 02:01:47 +08:00
if j['error']==true
2017-07-06 00:21:57 +08:00
m = j['title']
2017-08-22 08:55:35 +08:00
m << ', a project collaborator will take care of these, thanks :)'
2017-07-06 00:21:57 +08:00
warn m
2016-08-04 02:01:47 +08:00
markdown j['message']
end