|
| 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 |
| 3 | +declared_trivial = github.pr_title.include? "#trivial" |
| 4 | + |
| 5 | +# Make it more obvious that a PR is a work in progress and shouldn't be merged yet |
| 6 | +warn("PR is classed as Work in Progress") if github.pr_title.include? "[WIP]" |
| 7 | + |
| 8 | +# Warn when there is a big PR |
| 9 | +warn("Big PR") if git.lines_of_code > 500 |
| 10 | + |
| 11 | +# Don't let testing shortcuts get into master by accident |
| 12 | +fail("fdescribe left in tests") if `grep -r fdescribe spec/ `.length > 1 |
| 13 | +fail("fit left in tests") if `grep -r fit spec/ `.length > 1 |
| 14 | + |
| 15 | +# Ensure that labels have been used on the PR |
| 16 | +failure "Please add labels to this PR" if github.pr_labels.empty? |
| 17 | + |
| 18 | +# Ensure there is a summary for a PR |
| 19 | +failure "Please provide a summary in the Pull Request description" if github.pr_body.length < 5 |
| 20 | + |
| 21 | +# Note when a PR cannot be manually merged, which goes away when you can |
| 22 | +can_merge = github.pr_json["mergeable"] |
| 23 | +warn("This PR cannot be merged yet.", sticky: false) unless can_merge |
| 24 | + |
| 25 | +# Ensure that body of PR is not empty |
| 26 | +failure "Please add text to PR body" if github.pr_body.empty? |
| 27 | + |
| 28 | +# Changelog check |
| 29 | +changelog.check! |
| 30 | + |
| 31 | +# Commit lint check |
| 32 | +commit_lint.check |
| 33 | + |
| 34 | +# Runs rails_best_practices on modified and added files in the PR |
| 35 | +rails_best_practices.lint |
| 36 | + |
| 37 | +# Suggest code changes through inline comments in pull requests. |
| 38 | +suggester.suggest |
| 39 | + |
| 40 | +# README.md has a TOC |
| 41 | +toc.check! |
| 42 | + |
| 43 | +# Runs danger-rubocop linter |
| 44 | +rubocop.lint |
0 commit comments