-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDangerfile
More file actions
40 lines (32 loc) · 2.75 KB
/
Dangerfile
File metadata and controls
40 lines (32 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# frozen_string_literal: true
# github comment settings
github.dismiss_out_of_range_messages
# --------------------------------------------------------------------------------------------------------------------
# Warn when the PR is marked as in progress
# --------------------------------------------------------------------------------------------------------------------
warn('PR is classed as Work in Progress') if github.pr_title.include?('[WIP]') || github.pr_labels.include?('WIP')
# --------------------------------------------------------------------------------------------------------------------
# Warn when there is a big PR
# --------------------------------------------------------------------------------------------------------------------
warn('a large PR') if git.lines_of_code > 500
# --------------------------------------------------------------------------------------------------------------------
# Have you updated CHANGELOG.md?
# --------------------------------------------------------------------------------------------------------------------
changelog.check!
# --------------------------------------------------------------------------------------------------------------------
# Put labels on PRs, this will autofail all PRs without contributor intervention (this is intentional to force someone
# to look at and categorize each PR before merging)
# --------------------------------------------------------------------------------------------------------------------
fail('PR needs labels', sticky: true) if github.pr_labels.empty?
# --------------------------------------------------------------------------------------------------------------------
# Ensure that someone get's assigned to this PR
# --------------------------------------------------------------------------------------------------------------------
warn 'This PR does not have any assignees yet.' unless github.pr_json['assignee']
# --------------------------------------------------------------------------------------------------------------------
# State that this PR will trigger a release build if the target branch is 'release'
# --------------------------------------------------------------------------------------------------------------------
message('Merging this PR will trigger and tag a release build') if github.branch_for_base == 'release'
# --------------------------------------------------------------------------------------------------------------------
# Mainly to encourage writing up some reasoning about the PR, rather than just leaving a title.
# --------------------------------------------------------------------------------------------------------------------
warn('Please provide a summary in the Pull Request description') if github.pr_body.length < 3 && git.lines_of_code > 10