-
Notifications
You must be signed in to change notification settings - Fork 226
/
Dangerfile
18 lines (15 loc) · 808 Bytes
/
Dangerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Warn when there is a big PR
warn("Big PR") if git.lines_of_code > 500
# Sometimes its a README fix, or something like that - which isn't relevant for
# including in a CHANGELOG for example
has_app_changes = !git.modified_files.grep(/Source/).empty?
has_test_changes = !git.modified_files.grep(/Tests/).empty?
# Add a CHANGELOG entry for app changes
if !git.modified_files.include?("CHANGELOG.md") && has_app_changes
fail("Please include a CHANGELOG entry. \nYou can find it at [CHANGELOG.md](https://github.com/jpsim/SourceKitten/blob/main/CHANGELOG.md).")
message "Note, we hard-wrap at 80 chars and use 2 spaces after the last line."
end
# Non-trivial amounts of app changes without tests
if git.lines_of_code > 50 && has_app_changes && !has_test_changes
warn "This PR may need tests."
end