summaryrefslogtreecommitdiff
path: root/danger
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-19 22:11:55 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-19 22:11:55 +0000
commit5a8431feceba47fd8e1804d9aa1b1730606b71d5 (patch)
treee5df8e0ceee60f4af8093f5c4c2f934b8abced05 /danger
parent4d477238500c347c6553d335d920bedfc5a46869 (diff)
downloadgitlab-ce-5a8431feceba47fd8e1804d9aa1b1730606b71d5.tar.gz
Add latest changes from gitlab-org/gitlab@12-5-stable-ee
Diffstat (limited to 'danger')
-rw-r--r--danger/commit_messages/Dangerfile10
1 files changed, 8 insertions, 2 deletions
diff --git a/danger/commit_messages/Dangerfile b/danger/commit_messages/Dangerfile
index 064b8c94805..60bc90139ab 100644
--- a/danger/commit_messages/Dangerfile
+++ b/danger/commit_messages/Dangerfile
@@ -86,6 +86,12 @@ def unicode_emoji_regex
))x
end
+def count_filtered_commits(commits)
+ commits.count do |commit|
+ !commit.message.start_with?('fixup!', 'squash!')
+ end
+end
+
def lint_commit(commit) # rubocop:disable Metrics/AbcSize
# For now we'll ignore merge commits, as getting rid of those is a problem
# separate from enforcing good commit messages.
@@ -234,7 +240,7 @@ def lint_commit(commit) # rubocop:disable Metrics/AbcSize
fail_commit(
commit,
'Use full URLs instead of short references ' \
- '(`gitlab-org/gitlab-ce#123` or `!123`), as short references are ' \
+ '(`gitlab-org/gitlab#123` or `!123`), as short references are ' \
'displayed as plain text outside of GitLab'
)
@@ -285,7 +291,7 @@ def lint_commits(commits)
end
end
-if git.commits.length > 10 && !ce_upstream?
+if count_filtered_commits(git.commits) > 10 && !ce_upstream?
warn(
'This merge request includes more than 10 commits. ' \
'Please rebase these commits into a smaller number of commits.'