|
1 | | -# Sometimes it's a README fix, or something like that - which isn't relevant for |
2 | | -# including in a project's CHANGELOG for example |
| 1 | +# Adapted from https://github.com/capistrano/danger/blob/master/Dangerfile |
| 2 | +# Q: What is a Dangerfile, anyway? A: See http://danger.systems/ |
| 3 | + |
| 4 | +# ------------------------------------------------------------------------------ |
| 5 | +# Additional pull request data |
| 6 | +# ------------------------------------------------------------------------------ |
| 7 | +pr_number = github.pr_json["number"] |
| 8 | +pr_url = github.pr_json["_links"]["html"]["href"] |
| 9 | +# Sometimes its a README fix, or something like that - which isn't relevant for |
| 10 | +# including in a CHANGELOG for example |
3 | 11 | declared_trivial = github.pr_title.include? "#trivial" |
4 | 12 |
|
5 | | -# Make it more obvious that a PR is a work in progress and shouldn't be merged yet |
| 13 | +# Just to let people know |
6 | 14 | warn("PR is classed as Work in Progress") if github.pr_title.include? "[WIP]" |
7 | 15 |
|
8 | | -# Warn when there is a big PR |
9 | | -warn("Big PR") if git.lines_of_code > 500 |
| 16 | +# Ensure a clean commits history |
| 17 | +if git.commits.any? { |c| c.message =~ /^Merge branch '#{github.branch_for_base}'/ } |
| 18 | + fail('Please rebase to get rid of the merge commits in this PR') |
| 19 | +end |
| 20 | + |
| 21 | +commit_lint.check |
| 22 | + |
| 23 | +lgtm.check_lgtm |
10 | 24 |
|
11 | | -# Don't let testing shortcuts get into master by accident |
12 | | -fail("fdescribe left in tests") if `grep -r fdescribe specs/ `.length > 1 |
13 | | -fail("fit left in tests") if `grep -r fit specs/ `.length > 1 |
| 25 | +the_coding_love.random |
0 commit comments