summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2018-09-14 17:12:47 +0000
committerRobert Speicher <robert@gitlab.com>2018-09-14 17:12:47 +0000
commit69925767b7ac49b59c0292608b6655edb117e31d (patch)
tree02cb1f0d8766c3f8e1c4761c0c678a9408937ea4
parent044adc86b779cb330334f92136b180a77a17e119 (diff)
parent42f90b5f50fc55fe17aec4118190599d46b43da8 (diff)
downloadgitlab-ce-69925767b7ac49b59c0292608b6655edb117e31d.tar.gz
Merge branch 'danger-commit-count' into 'master'
Relax Danger requirements about changed lines Closes gitlab-org/release/framework#13 See merge request gitlab-org/gitlab-ce!21739
-rw-r--r--danger/commit_messages/Dangerfile9
1 files changed, 7 insertions, 2 deletions
diff --git a/danger/commit_messages/Dangerfile b/danger/commit_messages/Dangerfile
index b2099a8c198..e982e8ed7c5 100644
--- a/danger/commit_messages/Dangerfile
+++ b/danger/commit_messages/Dangerfile
@@ -26,6 +26,11 @@ def ce_upstream?
gitlab.mr_labels.any? { |label| label == 'CE upstream' }
end
+def too_many_changed_lines?(commit)
+ commit.diff_parent.stats[:total][:files] > 3 &&
+ lines_changed_in_commit(commit) >= 30
+end
+
def lint_commits(commits)
failures = false
@@ -102,10 +107,10 @@ def lint_commits(commits)
failures = true
end
- if !details && lines_changed_in_commit(commit) >= 20
+ if !details && too_many_changed_lines?(commit)
fail_commit(
commit,
- 'Commits that change more than 20 lines ' \
+ 'Commits that change 30 or more lines in more than three files ' \
'must describe these changes in the commit body'
)