Merge branch 'danger-comply-with-suggestions' into 'master'
When using suggestions, squash must be enabled See merge request gitlab-org/gitlab-ce!29687
This commit is contained in:
commit
ff61946b69
1 changed files with 11 additions and 1 deletions
|
@ -80,7 +80,7 @@ def unicode_emoji_regex
|
||||||
))x
|
))x
|
||||||
end
|
end
|
||||||
|
|
||||||
def lint_commit(commit)
|
def lint_commit(commit) # rubocop:disable Metrics/AbcSize
|
||||||
# For now we'll ignore merge commits, as getting rid of those is a problem
|
# For now we'll ignore merge commits, as getting rid of those is a problem
|
||||||
# separate from enforcing good commit messages.
|
# separate from enforcing good commit messages.
|
||||||
return false if commit.message.start_with?('Merge branch')
|
return false if commit.message.start_with?('Merge branch')
|
||||||
|
@ -114,6 +114,16 @@ def lint_commit(commit)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Fail if a suggestion commit is used and squash is not enabled
|
||||||
|
if commit.message.start_with?('Apply suggestion to') && !gitlab.mr_json['squash']
|
||||||
|
fail_commit(
|
||||||
|
commit,
|
||||||
|
'If you are applying suggestions, squash needs to be enabled in the merge request'
|
||||||
|
)
|
||||||
|
|
||||||
|
failures = true
|
||||||
|
end
|
||||||
|
|
||||||
unless subject_starts_with_capital?(subject)
|
unless subject_starts_with_capital?(subject)
|
||||||
fail_commit(commit, 'The commit subject must start with a capital letter')
|
fail_commit(commit, 'The commit subject must start with a capital letter')
|
||||||
failures = true
|
failures = true
|
||||||
|
|
Loading…
Reference in a new issue