-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDangerfile
24 lines (19 loc) · 1 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
# By Jan Schwarz 03/24/2021
# STRV s.r.o. 2021
# STRV
# Sometimes its a README fix, or something like that - which isn't relevant for including in a CHANGELOG for example
declared_trivial = github.pr_title.include?("#trivial") || github.pr_title.include?("[WIP]") || github.pr_body.include?("#trivial")
# Uncomment following lines if you want to enforce CHANGELOG updates
if git.lines_of_code > 50 && !git.modified_files.include?("CHANGELOG.md") && !git.added_files.include?("CHANGELOG.md") && !declared_trivial
fail("No CHANGELOG changes made")
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.include? "[WIP]"
# Mainly to encourage writing up some reasoning about the PR, rather than just leaving a title
if github.pr_body.length < 5
fail("Please provide a summary in the Pull Request description")
end
# Warn when there is a big PR
if git.lines_of_code > 1000
warn("Big PR - you should create smaller!")
end