Commit 41c053cc authored by Lin Jen-Shin's avatar Lin Jen-Shin

Merge branch 'danger-skip-counting-fixup-commits' into 'master'

Danger: Skip counting fixup commits as quality of merge request

See merge request gitlab-org/gitlab!19762
parents dbd0a8b3 f70681ce
......@@ -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.'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment