Commit f70681ce authored by Elan Ruusamäe's avatar Elan Ruusamäe Committed by Lin Jen-Shin

Danger: Skip counting fixup commits as quality of merge request

parent dbd0a8b3
......@@ -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