-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDangerfile
31 lines (23 loc) · 1.14 KB
/
Dangerfile
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
def warning_important_file_changed(file)
warn "Modified #{file}" if git.modified_files.include?(file)
end
# 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 + github.pr_body).include? '[WIP]'
# Warn when there is a big PR
warn 'Big PR' if git.lines_of_code > 500
warning_important_file_changed '.gitignore'
warning_important_file_changed '.travis.yml'
warning_important_file_changed 'Gemfile'
warning_important_file_changed 'Gemfile.lock'
warning_important_file_changed 'Podfile'
warning_important_file_changed 'Podfile.lock'
fail 'Please add labels to this PR' if github.pr_labels.empty?
if github.pr_body.length < 5
fail 'Please provide a summary in the Pull Request description'
end
# Ignoring warnings from Pods
xcode_summary.ignored_files = 'Pods/**'
slather.configure('Play.xcodeproj', 'Play', options: { workspace: 'Play.xcworkspace' })
slather.notify_if_coverage_is_less_than(minimum_coverage: 45, notify_level: :warning)
slather.notify_if_modified_file_is_less_than(minimum_coverage: 50, notify_level: :warning)
slather.show_modified_files_coverage