diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-15 18:06:24 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-15 18:06:24 +0000 |
commit | eca3cd3a9e7d9ea680086cad8150050ec8cdef3f (patch) | |
tree | c3d262e0d8e721fc138c2d617f501fb09876f1b6 /danger/commit_messages | |
parent | 6e81d7f6283fae1b22f66b9d9b133243921cbd9e (diff) | |
download | gitlab-ce-eca3cd3a9e7d9ea680086cad8150050ec8cdef3f.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'danger/commit_messages')
-rw-r--r-- | danger/commit_messages/Dangerfile | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/danger/commit_messages/Dangerfile b/danger/commit_messages/Dangerfile index 064b8c94805..da5a63633c3 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. @@ -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.' |